当前分类: 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...
查看答案
问题:单选题Given the following code: public class Test { void printValue(int m){ do { System.out.println("The value is"+m); } while( --m 10 ) } public static void main(String arg[]) { int i=10; Test t= new Test(); t.printValue(i); } ...
问题:单选题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 { public static void main (Stringargs) { int a = new int [1] modify(a); System.out.printIn(a[0]); } public static void modify (int a) { a[0] ++; } } What is the result?()A The program runs and prints “0”B The prog...
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:多选题Which statements concerning the following code are true?() class a { public a() {} public a(int i) { this(); } } class b extends a { public boolean b(String msg) { return false; } } class c extends b { private c() { super(); } publi...
问题:Which of these are keywords in Java?() ...
问题:public class X implements Runnable( private int x; priv...
问题:单选题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. return oa[0]; 8. } 9. } When is the float object created in line 3, eligible for garbage collection?(...
问题:单选题public class WhileFoo { public static void main (String args) { int x= 1, y = 6; while (y--) {x--;} system.out.printIn(“x=” + x “y =” + y); } } What is the result?()A The output is x = 6 y = 0B The output is x = 7 y = 0C The output is ...
问题:public class X { public static void main(String [] args) { ...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:public class X { public object m () { object o = new flo...
问题:int x= 10; do { x--; } while(x< 10); How many times will...
问题:Which two create an instance of an array?() ...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:单选题public class Test { public static void main (String args) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.printIn(foo. i); } } What is the result?()A Compilation will fail.B Compilation ...
问题:单选题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”...
问题:单选题1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()A Compilation will fail...
问题:Which two statements are true regarding the creation of a de...