posted 23 years ago
Below is one of the answers in JQPlus ( Question Id : 953578810580 )
> A top-level nested interface can contain static member variables
Now typically an interface contains static variables and non-static method prototypes. Does the above answer refer to the variables only or
rather what does it mean by "can contain static member variables" ?
The explanation further gives an example as :
public interface I1{
public void mA();
public interface Inner1
{
int k=10;
public void innerA();
}
}
Here from above the Inner1 is implicitly static.
What is the use of declaring the interface within another interface and why does it become implicitly static ? Ofcourse the usage like
I1.Inner1 is known but i am still not clear ?