|
SCJP (Sun Certified Programmer for the Java 2 Platform) tutorials |
|
|
|
Contributed by Joe
|
|
Friday, 07 July 2006 |
|
Page 3 of 7 SCJP (Sun Certified Programmer for the Java 2 Platform) tutorialsGiven: 1. public class Test { 2. public static void main (String [] args) { 3. string foo = “blue”; 4. string bar = foo; 5. foo = “green”; 6. System.out.printIn(bar); 7. } 8. }
What is the result? A. An exception is thrown. B. The code will not compile. C. The program prints “null” D. The program prints “blue” E. The program prints “green”
Which code determines the int value foo closest to a double value bar? A. Int foo = (int) Math.max(bar); B. Int foo = (int) Math.min(bar); C. Int foo = (int) Math.abs(bar); D. Int foo = (int) Math.ceil(bar); E. Int foo = (int) Math.floor(bar); F. Int foo = (int) Math.round(bar);
|
|
Last Updated ( Monday, 17 July 2006 )
|