Neha,
i am not following how Q3 works.
because if i compile the above code i am getting undefined variable B.
As Marilyn mentioned earlier, all classes defined in an interface
are implicitly
static. Their names/types are constructed
by prefixing the types with the name of the enclosing class names.
For instance, the name for class A in interface B of question 3
is actually B.A.
The correct way and the only way to instantiate a static class is by "unqualified" instance creation expression, i.e.
without an expression in front of the "new" operator.
So, I think the statement B.new A() should be changed to:
new B.A();
Give it a try and you will see it compiles.
[This message has been edited by Nain Hwu (edited December 09, 2001).]
[This message has been edited by Nain Hwu (edited December 09, 2001).]