Saturday, February 25, 2023

java class in a class

A class defined in another class is called a nested class when it has the static keyword and inner class if it does not has the static keyword. A inner class does not has a reference to its outer class but an inner class has. In other words, a inner class can access the outer class instance variable