System.out.print("Hello, World"); // no newline System.out.println("Hello\n\nWorld"); // adds newline at end int feet = 6, inches = 3; System.out.printf("I am %d feet and %d inches tall\n", feet, inches); // just like printf in C
System.out.print("The number of states in the U.S. is " + 50); int sides = 8; System.out.println("Number of sides on a stop sign = " + sides);
import java.util.Scanner;
import java.util.Scanner; // yadda yadda Scanner input = new Scanner(System.in); // now we can use the object to read data from the keyboard. // Some sample calls: int x = input.nextInt(); double y = input.nextDouble(); String s = input.next();