highest precedence: () * / % lowest precedence: + -
3 + 4 * 5 => 23 (3 + 4) * 5 => 35
int i; double x; x = 23; i = 18.4; // warning: "possible loss of precision"
someFloat = 1 / 2; // what does this give?
someFloat = (double)1 / 2; someFloat = 1 / (double)someInt; someInt = (int)someFloat / 4; someInt = (int)(someFloat * 10) - 10;
System.out.print("What is your first name? "); String name = in.next(); System.out.println("Hello, " + name); int count = name.length(); System.out.println("Your name has " + count + " letters in it."); char firstInitial = name.charAt(0); System.out.println("Your first initial is " + firstInitial); String firstPart = name.substring(0, 3); System.out.println("The first three letters are " + firstPart);