|
|

Sun 310-025: Sun Certified Java Programmer
|
#1. Given: 1. public class Test { 2. public static void main (String [] args ) { 3. string foo = “blue”; 4. string bar = foo; 5. foo = “green”; 7. } 8. }
What is the result?
|
|
#2. Which code determines the int value foo closest to a double value bar?
|
|
#3. Which two demonstrate encapsulation of data?(Choose Two)
|
|
#4. Exhibit: 1. class A { 2. public String toString () { 3. return “4”; 4. } 5. } 6. class B extends A { 7. 8. public String toString () { 8. return super.toString() + “3”; 9. } 10. } 11. public class Test { 12. public static void main (String[]args ) { 13. System. out. printIn(new B ()); 14. } 15.}
What is the result?
|
|
#5. Which two statements are true?(Choose Two)
|
|
#6. Given: 1. public class MethodOver { 2. private int x, y; 3. private float z; 4. public void setVar(int a, int b, float c){ 5. x = a; 6. y = b; 7. z = c; 8. } 9. }
Which two overload the setVar method? (Choose Two)
|
|
#7. Which statements about static inner classes are true?(Choose Two)
|
|
#8. Given: 1. public class X { 2. public object m () { 3. object o = new float (3.14F); 4. object [] oa = new object [1]; 5. oa[0]= o; 6. o = null; 7. oa[0] = null; 9. return o; 9. } 10. }
W hen is the float object created in line 3,eligible for garbage collection?
|
|
#9. Which two interfaces provide the capability to store objects using a key-value pair?(Choose Two)
|
|
#10. Which interface does java.util.Hashable implement?
|
|
|
|
gen. 0.148
|
Server date 23:33 15-03-2010
|
Developed by Zip © 2006
|
|
 |
|
|