单项选择题
public classYippee{
public static void main(String[]args){
for(intx=1;xSystem.out.print(args[x]+"");
}
}
}
and two separate command line invocations:j
avaYippee
javaYippee1234
What is the result?()
A.No output is produced. 123
B.No output is produced. 234
C.No output is produced. 1234
D.An exception is thrown at runtime. 123
E.An exception is thrown at runtime. 234
F.An exception is thrown at runtime. 1234
相关考题
-
多项选择题
Which two are true?()
A.A finalizer may NOT be invoked explicitly.
B.The finalize method declared in class Object takes no action.
C.super.finalize()is called implicitly by any over riding finalize method.
D.The finalize method for a given objec twill be called no more than once by the garbage collector.
E.The order in which finalize will be called on two objects is based on the order in which the two objects became finalizable. -
单项选择题
11.public void genNumbers(){ 12.ArrayList numbers=new ArrayList(); 13.for(inti=0;i 14.intvalue=i*((int)Math.random()); 15.IntegerintObj=newInteger(value); 16.numbers.add(intObj); 17.} 18.System.out.println(numbers); 19.} Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbagec ollection?()
A.Line16
B.Line17
C.Line18
D.Line19
E.The object is NOT a candidate for garbage collection. -
单项选择题
1.public class GC{ 2.private Objec to; 3.private void doSomethingElse(Object obj){o=obj;} 4.public void doSomething(){ 5.Object o=new Object(); 6.doSomethingElse(o); 7.o=new Object(); 8.doSomethingElse(null); 9.o=null; 10.} 11.} When the doSomething method is called,after which line does the Object created in line 5 become available for garbage collection?()
A.Line5
B.Line6
C.Line7
D.Line8
E.Line9
F.Line10
