List of usage examples for java.lang System out
PrintStream out
To view the source code for java.lang System out.
Click Source Link
From source file:Main.java
public static void main(String[] args) { System.out.println("Byte.MIN = " + Byte.MIN_VALUE); System.out.println("Byte.MAX = " + Byte.MAX_VALUE); System.out.println("Short.MIN = " + Short.MIN_VALUE); System.out.println("Short.MAX = " + Short.MAX_VALUE); System.out.println("Integer.MIN = " + Integer.MIN_VALUE); System.out.println("Integer.MAX = " + Integer.MAX_VALUE); System.out.println("Long.MIN = " + Long.MIN_VALUE); System.out.println("Long.MAX = " + Long.MAX_VALUE); System.out.println("Float.MIN = " + Float.MIN_VALUE); System.out.println("Float.MAX = " + Float.MAX_VALUE); System.out.println("Double.MIN = " + Double.MIN_VALUE); System.out.println("Double.MAX = " + Double.MAX_VALUE); }
From source file:Main.java
License:asdf
public static void main(String[] argv) throws Exception { System.out.println("abasdfasdf1 2wasdfasdf9_8asdfasdfz asdfasdfyx7".replaceAll("\\D", "")); }
From source file:PrintfExamples.java
public static void main(String[] args) { System.out.printf("My name is %s\n", "Joe"); System.out.printf("%s://%s/%s\n", "http", "host", "path"); }
From source file:Main.java
public static void main(String[] args) { System.out.println("#1:" + Thread.interrupted()); Thread mainThread = Thread.currentThread(); mainThread.interrupt();/*from ww w .ja v a2 s. co m*/ System.out.println("#2:" + mainThread.isInterrupted()); System.out.println("#3:" + mainThread.isInterrupted()); System.out.println("#4:" + Thread.interrupted()); System.out.println("#5:" + mainThread.isInterrupted()); }
From source file:Main.java
public static void main(String[] args) throws Exception { System.out.println(System.lineSeparator() + "This is from java2s.com"); }
From source file:Main.java
public static void main(String[] args) { System.out.printf("'%d' %n", 1234); System.out.printf("'%6d' %n", 1234); System.out.printf("'%-6d' %n", 1234); System.out.printf("'%06d' %n", 1234); System.out.printf("'%(d' %n", 1234); System.out.printf("'%(d' %n", -1234); System.out.printf("'% d' %n", 1234); System.out.printf("'% d' %n", -1234); System.out.printf("'%+d' %n", 1234); System.out.printf("'%+d' %n", -1234); }
From source file:Main.java
public static void main(String[] argv) throws Exception { System.out.printf("Two decimal digits: %.2f\n", 10.0 / 3.0); }
From source file:Main.java
public static void main(String... args) { byte b = 2; System.out.println(Byte.hashCode(b)); }
From source file:Main.java
public static void main(String[] args) { System.out.println(Long.toString(10, 8)); // returns a string representation of the specified long with radix 10 String retval = Long.toString(1234567890, 10); System.out.println("Value = " + retval); // returns a string representation of the specified long with radix 16 retval = Long.toString(1234567890, 16); System.out.println("Value = " + retval); // returns a string representation of the specified long with radix 8 retval = Long.toString(1234567890, 8); System.out.println("Value = " + retval); }
From source file:PrintfExamples.java
public static void main(String[] args) { System.out.printf("String is '%5s'\n", "A"); System.out.printf("String is '%-5s'\n", "A"); System.out.printf("String is '%.5s'\n", "Happy Birthday!"); }