Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.4k points)

What is the difference between static and non-static nested class?

1 Answer

0 votes
by (46k points)

An inner class, by description, cannot be static, so I am working to recast your question as "What is the distinction among static and non-static nested classes?"

A non-static nested class has full passage to the members of the class inside which it is nested. A static nested class doesn't have a source to a nesting instance, so a static nested class cannot request non-static methods or access non-static areas of an example of the class within which it is nested.

Related questions

Browse Categories

...