A class can be defined as a member of another class, analogous to instance variables and methods. |
The code within the member class can refer to any fields and methods of the enclosing class. |
Every instance of a member class is associated with a particular instance of the enclosing class. |
Syntax: public class A { //declare instance variables and methods of A here //methods may create new B private class B { //declare instance variables and methods of B here //methods can refer to instance vars and methods of A } } |