多项选择题
Which of these are keywords in Java?()
A.default
B.NULL
C.String
D.throws
E.long
点击查看答案&解析
相关考题
-
单项选择题
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 main(String args[]) { A x = new A(); B y = new B(); C z = new C(); // insert statement here } }
A.x = y;
B.z = x;
C.y = (B) x;
D.z = (C) y;
E.y = (A) y; -
单项选择题
WhichmethodsfromtheStringandStringBufferclassesmodifytheobjectonwhichtheyarecalled?()
A.The charAt() method of the String class.
B.The toUpperCase() method of the String class.
C.The replace() method of the String class.
D.The reverse() method of the StringBuffer class.
E.The length() method of the StringBuffer class. -
单项选择题
Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? () public class Q76a9 { static String f() { String a = "hello"; String b = "bye"; // (0) String c = b + "!"; // (1) String d = b; b = a; // (2) d = a; // (3) return c; // (4) } public static void main(String args[]) { String msg = f(); System.out.println(msg); // (5) } }
A.The line marked (1).
B.The line marked (2).
C.The line marked (3).
D.The line marked (4).
E.The line marked (5).
