What is the difference between an inner class and a static nested class?

1) First and most important difference between Inner class and nested static class is that Inner class require instance of outer class for initialization and they are always associated with instance of enclosing class. On the other hand nested static class is not associated with any instance of enclosing class.

Sizin İçin Seçtik  What are class constructors in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *