public class Main { public static void main(String[] args) { String s = "Hello, World!"; System.out.println(s); // prints s on its own line String t = "Computer Science is fun"; System.out.println(t); // prints t on its own line System.out.print(s); // prints s System.out.print(t); // prints t System.out.println(); // goes to a new line System.out.println(s + t); // prints st on its own line int i = 6; System.out.println("i = " + i); // prints out i double d = 6.0; System.out.println("d = " + d); // prints out d char c = '#'; System.out.println("c = " + c); // prints out c boolean b = true; System.out.println("b = " + b); // prints out b Object o = new Object(); System.out.println("o = " + o); // prints out o // prints i, d, c, b, and o right next to each other System.out.println(s + t + i + d + c + b + o); // a useful debugging tactic System.out.println("execution is now here"); } } |