Home » Java Programming » Declarations and Access Control

What will be the output of the program? 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); } }

← Previous Next →

Discussion & Comments

No comments yet. Be the first to comment!