"Thinkinginjava" 6, test your own Output class library

Source: Internet
Author: User

/*** Book: Thinking in Java * Features: Custom tools library for System.out.println simplification * files: print.java* time: October 7, 2014 19:45:31* Author: cutter_point*/ Package Net.mindview.util;import Java.io.*;import Javax.print.attribute.standard.printquality;public class Print { public static void Print (object obj)//Output an object, newline {System.out.println (obj+ "  obj1");} public static void print ()//empty line break {System.out.println ();} Output public static void Printnb (Object obj) {System.out.print (obj+ "-obj2") without newline;} /* * PrintStream Printstream.format (string format, Object ... args)     * Writes a formatted string to this output stream using the specified format string and parameters. */public static PrintStream printf (String format, Object ... args) {return System.out.printf (format+ "PrintStream", args) ;}}


/*** book: "Thinking in Java" * Function: Test your own output class library * file: printtest.cpp* time: October 7, 2014 19:59:03* Author: cutter_point*/package Lesson6accesscontrol;import Static net.mindview.util.print.*;p Ublic class Printtest {public static void main (String [] args) {print ("Available from now on!"); Print (+);p rint (100L);p rint (3.14159);}}

Output:

Available from now on! Obj1
Obj1
Obj1
3.14159 obj1





"Thinkinginjava" 6, test your own Output class library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.