当前分类: SCJP程序员认证考试
问题:单选题Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?() class A {} class B extends A {} class C extends A {} public class Q3ae4 { public static void...
查看答案
问题:Which are syntactically valid statement at// point x?() ...
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:单选题Given: 310-025 Leading the way in IT testing and certification tools, www.testking.com - 48 - public class foo { static String s; public static void main (Stringargs) { system.out.printIn (“s=” + s); } } What is the result?()A The c...
问题:public interface Foo{ int k = 4; } Which three are equi...
问题:单选题Which gets the name of the parent directory file “file.txt”?()A String name= File.getParentName(“file.txt”);B String name= (new File(“file.txt”)).getParent();C String name = (new File(“file.txt”)).getParentName();D String name= (new File(“file.txt”...
问题:单选题10. public class Hello { 11. String title; 12. int value; 13. public Hello() { 14. title += “ World”; 15. } 16. public Hello(int value) { 17. this.value = value; 18. title = “Hello”; 19. Hello(); 20. } 21. } and: 30. Hello c = new Hello(5)...
问题:单选题int i = 0, j = 1; if ((i++ == 1) (j++ == 2)) { i = 42; } System.out.println(“i = “ + i + “, j = “ + j); What is the result?()A i = 1, j = 2B i = 1, j = 1C i = 42, j = 2D i = 42, j = 1E Compilation fails....
问题:public class X { public static void main(String [] args) { ...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:单选题1. public class ForBar { 2. public static void main(String []args) { 3. int i = 0, j = 5; 4. tp: for (;;) { 5. i ++; 6. for(;;) 7. if(i --j) break tp; 8. } 9. system.out.printIn(“i = ” + i + “, j = “+ j); 10. } 11. } What is the resu...
问题:public class X implements Runnable( private int x; priv...
问题:多选题10. public class MyClass { 11. 12. public Integer startingI; 13. public void methodA() { 14. Integer i = new Integer(25); 15. startingI = i; 16. methodB(i); 17. } 18. private void methodB(Integer i2) { 19. i2 = i2.intValue(); 20. 21. } 22. ...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:Which of these are keywords in Java?() ...
问题:public class Score implements Comparable { private int wins...
问题:public class X { public object m () { object o = new flo...
问题:多选题1. public class A { 2. public void method1() { 3. B b=new B(); 4. b.method2(); 5. // more code here 6. } 7. } 1. public class B { 2. public void method2() { 3.C c=new C(); 4. c.method3(); 5. // more code here 6. } 7. } 1. public class C {...
问题:When comparing java.io.BufferedWriter to java.io.FileWriter,...
问题:多选题public class TestString3 { public static void main(String[] args) { // insert code here System.out.println(s); } } Which two code fragments, inserted independently at line 3, generate the output 4247?()AString s = “123456789”; s = (s-”123”).repla...