Prev Next

Java / static keyword

Can a static nested class access instance members of enclosing class?

No. Unlike static class methods, a static nested class cannot refer directly to instance variables or methods defined in its enclosing class; it can use them only through an object reference.

More Related questions...

Show more question and Answers...


Comments & Discussions