当前分类: SCJP程序员认证考试
问题:单选题11. double d = Math.random(); Which is true about d after line 11?()A d = 1.0B 0.0 = d 1.0C 0.0 = d Double.MAX_VALUED 0.0 = d = Double.MAX_VALUEE Double.MIN_VALUE = d Double.MAX_VALUE...
查看答案
问题:单选题public class Wow { public static void go(short n) {System.out.println(”short”); } public static void go(Short n) {System.out.println(”SHORT”);} public static void go(Long n) {System.out.println(” LONG”); } public static void main(String [] args) { ...
问题:单选题public class Bootchy { int bootch; String snootch; public Bootchy() { this(”snootchy”); System.out.print(”first “); } public Bootchy(String snootch) { this(420, “snootchy”); System.out.print(”second “); } public Bootchy(int bootch, String sn...
问题:单选题1. public class test ( 2. public static void main(string args[]) { 3. int 1= 0; 4. while (i) { 5. if (i==4) { 6. break; 7. } 8. ++i; 9. } 10. 11. } 12. ) What is the value of i at line 10?()A 0B 3C 4D 5E The code will not compile....
问题:多选题Which two are equivalent?()A3/2B32C3*4D32E3*2^2F32...
问题:多选题class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?()AVoid setVar(float f) {x =...
问题:int i = 1,j = -1; switch (i) { case 0, 1:j = 1; case 2: j...
问题:单选题public class Foo { public void main( String[] args ) { System.out.println( “Hello” + args[0] ); } } What is the result if this code is executed with the command line?()A HelloB Hello FooC Hello worldD Compilation fails.E The code does not ru...
问题:单选题public class X { public static void main (Stringargs) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()A The program runs and print...
问题:单选题System.out.format(”Pi is approximately %d.”, Math.PI); What is the result?()A Compilation fails.B Pi is approximately 3.C Pi is approximately 3.141593.D An exception is thrown at runtime....
问题:多选题class A { } class Alpha { private A myA = new A(); void dolt( A a ) { a = null; } void tryIt() { dolt( myA ); } } Which two statements are correct?()AThere are no instanced of A that will become eligible for garbage collection.BExplicitly se...
问题:11. public class Test { 12. public void foo() { 13. assert...
问题:单选题What will be written to the standard output when the following program is run?() public class Q63e3 { public static void main(String args[]) { System.out.println(9 ^ 2); } }A 81B 7C 11D 0E false...
问题:单选题10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo) { return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. // insert code here 16.); 17. } 18. } Which code, inserted at line 15, allows the class ...
问题:Which method is an appropriate way to determine the cosine o...
问题:Which of the following statements are legal?() ...
问题:Which statement is true for the class java.util.ArrayList?()...
问题:单选题How can you create a listener class that receives events when the mouse is moved?()A By extending MouseListener.B By implementing MouseListener.C By extending MouseMotionListener.D By implementing MouseMotionListener.E Either by extending MouseMot...
问题:11. public enum Title { 12. MR(”Mr.”), MRS(”Mrs.”), MS(”Ms....
问题:多选题Which two statements are reserved words in Java?()ARunBImportCDefaultDImplement...