System.out : System « java.lang « Java by API






System.out

    
/*
 * Output:
true
A
500
40000
45.67
45.67
Hello
99
 
 */

import java.io.PrintWriter;

public class MainClass {

  public static void main(String args[]) {

    try {
      PrintWriter pw = new PrintWriter(System.out);

      // Experiment with some methods
      pw.println(true);
      pw.println('A');
      pw.println(500);
      pw.println(40000L);
      pw.println(45.67f);
      pw.println(45.67);
      pw.println("Hello");
      pw.println(new Integer("99"));

      // Close print writer
      pw.close();
    } catch (Exception e) {
      System.out.println("Exception: " + e);
    }
  }
}
           
         
    
    
    
  








Related examples in the same category

1.System.exit(int status)
2.System.in
3.System.in.read()
4.System: arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
5.System: clearProperty(String key)
6.System: console()
7.System: currentTimeMillis()
8.System: getenv(String key)
9.System: getProperty(String name)
10.System.getProperty ("user.dir")
11.System: getProperty(String key, String def)
12.System: getProperties()
13.System.identityHashCode(Object x)
14.System: nanoTime()
15.System.setErr(PrintStream err)
16.System: setIn(InputStream in)
17.System: setOut(PrintStream err)
18.System: setProperty(String key, String value)