- Which are the most commonly used number types in Java?
- When does the cast (long) x yield a different result from the call Math.round(x)?
- How do you round the double value x to the nearest int value, assuming that you know that it is less than 2 * 10^9?
- What is the difference between the following two statements? final double CM_PER_INCH = 2.54; and public static final double CM_PER_INCH = 2.54;
- What is wrong with the following statement? double circumference = 3.14 * diameter;
- What is the meaning of the following statement? balance = balance + amount;
- What is the value of n after the following sequence of statements? n--; n++; n--;
- What is the value of 1729 / 100? Of 1729 % 100?
- Why doesn't the following statement compute the average of s1, s2, and s3? double average = s1 + s2 + s3 / 3; //Error
- What is the value of Math.sqrt(Math.pow(x,2) + Math.pow(y,2)) in mathematical notation?
- Why can't you call x.pow to compute x^y?
- Is the call System.out.println(4) a static method call?
- Assuming the String variable s holds the value "Agent", what is the effect of the assignment s = s + s.length()?
- Assuming the String variable river holds the value "Mississipi", what is the value of river.substring(1,2)? Of river.substring(2, river.length() - 3)?
- Why can't input be read directly from System.in?
- Suppose "in" is a Scanner object that reads from System.in, and your program calls String name = in.next(); What is the value of name if the user enters John Q. Public?