问题:public class X implements Runnable( private int x; priv...
查看答案
问题:单选题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...
问题:单选题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...
问题:单选题public class Threads5 { public static void main (String[] args) { new Thread(new Runnable() { public void run() { System.out.print(”bar”); } }).start(); } } What is the result?()A Compilation fails.B An exception is thrown at runtime.C The c...
问题:class Foo { private int x; publicFoo(intx) {this.x=x; } p...
问题:Which statements concerning casting and conversion are true?...
问题:Which two statements are true regarding the creation of a de...
问题:Which of these are keywords in Java?() ...
问题:int i = 0; while (true) { if(i==4) { break; } ++i; } S...
问题:多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() { public void run() { doStuff(); } }Bnew Thread() { public void start() { doStuff(); } }Cnew Thread() { public void start() { doStuff(); } } .run();Dnew Thr...
问题:多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected...
问题:12. void start() { 13. A a = new A(); 14. B b = new B(); ...
问题:单选题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 X { public static void main(String [] args) { ...
问题:Which statement is true?()...
问题:多选题Which declarations of identifiers are legal?()A$personsBTwoUsersC*pointDthisE_endline...
问题:public class X { public object m () { object o = new flo...
问题:单选题11. class Payload { 12. private int weight; 13. public Payload(int wt) { weight = wt; } 13. public void setWeight(mt w) { weight = w; } 15. public String toString { return Integer.toString(weight); } 16. } 17. 18. public class TestPayload { 19....
问题:填空题3. string foo = “ABCDE”; 4. foo.substring(3); 5. foo.concat(“XYZ”); 6. Type the value of foo at line 6.()...
问题:import java.awt*; public class X extends Frame ( public ...