kyoto dreams
Wednesday, January 11, 2006
  Caster 3 Given the class below. Will it compile?

If so, what's the output?

If not, how would you fix it?

public class Caster3 {
public static void main(String[] args) {
Object i = new Integer(32);
Integer o = (Integer) i;

out((Object) o);
}

static void out(Object o) {
System.out.println("Object out");
}

static void out(Integer i) {
System.out.println("Integer out");
}
}
 
Comments: Post a Comment

<< Home

ARCHIVES
May 2005 / June 2005 / August 2005 / January 2006 / March 2006 /


Powered by Blogger