问题:多选题Which two CANNOT directly cause a thread to stop executing?()ACalling the yield method.BCalling the wait method on an object.CCalling the notify method on an object.DCalling the notifyAll method on an object.ECalling the start method on another Thread ...
查看答案
问题:多选题Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()AMember variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.BMemb...
问题:public class X { public object m () { object o = new flo...
问题:填空题1. public class test { 2. public static string output = “” 3. 4. public static void foo(int i) { 5. try { 6. if(i= =1) { 7. throw new Exception (); 8. } 9. output += “1”; 10. ) 11. catch(Exception e) { 12. output += “2”; 13. return...
问题:public class X implements Runnable ( private int x; priv...
问题:Which of these are keywords in Java?() ...
问题:public class X { public static void main(String [] args) { ...
问题:单选题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”...
问题:单选题public class Test { public static void main(String Args[]) { int i =1, j = 0; switch(i) { case 2: j +=6; case 4: j +=1; default: j +=2; case 0: j +=4; } System.out.println(“j =” +j); } } What is the result? ()A 0B 2C 4D 6E 9F 13...
问题:单选题Which fragment is an example of inappropriate use of assertions? ()A assert (!(map.contains(x))); map.add(x);B if (x 0){}else { assert (x==0); }C public void aMethod(int x) { assert (x 0); }D assert (invariantCondition()); return retval;E switch...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:单选题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...
问题:单选题Given the following code: 1) public void modify() { 2) int i, j, k; 3) i = 100; 4) while ( i 0 ) { 5) j = i * 2; 6) System.out.println (" The value of j is " + j ); 7) k = k + 1; 8) i--; 9) } 10) } Which line might c...
问题:单选题public class foo { public static void main (string[]args) try {return;} finally {system.out.printIn(“Finally”);} } What is the result?()A The program runs and prints nothing.B The program runs and prints “Finally”C The code compiles, but an exc...
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:单选题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 statements concerning the value of a member variable are true, when no explicit assignments have been made?()AThe value of an int is undetermined.BThe value of all numeric types is zero.CThe compiler may issue an error if the variable is used bef...
问题://point X public class foo { public static void main (Str...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:public class X implements Runnable( private int x; priv...