Which statement is true?
A. After line 8, three objects are eligible for garbage collection
B. After line 8, two objects are eligible for garbage collection
C. After line 8, one object is eligible fo...
Which set of commands prints Hello Duke in the console?
A.
javac Greeting
java Greeting Duke
B.
javac Greeting.java Duke
java Greeting
C.
javac Greeting.java
java Greeting Duke
D.
javac Greeting.java...
What is the result?
A.
class java.lang.String
class java.lang.String
class java.util.ArrayList
B.
class java.lang.Object
class java.lang. Object
class java.util.Collection
C.
class java.lang.StringBu...
Which two statements are true for a two-dimensional array of primitive data type?
A. It cannot contain elements of different types.
B. The length of each dimension must be the same.
C. At the declara...
Which three code fragments, when replaced individually for foo, enables the program to compile?
A. int i : array
B. int i = 0; i < 1;
C. ; ;
D. ; i < 1; i++
E. i = 0; i<1;
What will be the output?
A.
SpecialException: Thrown at end of doSomething() method
B.
Error in thread "main" java.lang.ArrayIndexOutOfBoundsError
C.
Exception in thread "main" java.lang.ArrayIndexOu...