black

SCJP程序员认证考试

登录

单项选择题

public class Test { 
public static void main(String args[]) { 
class Foo { 
public int i = 3;
} 
Object o = (Object)new Foo(); 
 Foo foo = (Foo)o; 
System.out.println(“i = “ + foo.i);
} 
} 
What is the result?()  

A. i = 3
B. Compilation fails.
C. A ClassCastException is thrown at line 6.
D. A ClassCastException is thrown at line 7.

相关考题

单项选择题 Whichinterfacedoesjava.util.Hashableimplement?()

多项选择题 Whichtwointerfacesprovidethecapabilitytostoreobjectsusingakey-valuepair?()

单项选择题 public class X {   public object m () {   object o = new float (3.14F);   object oa = new object [1];   oa[0]= o;   o = null;   oa[0] = null;   return o;   }   }   When is the float object created in line 3, eligible for garbage collection?()

All Rights Reserved 版权所有©财会考试题库(ckkao.com)

备案号:湘ICP备2022003000号-2