What are Nested classes? What are Types of nested class? to know that read the following correctly and completely. NESTED CLASSES. In java , just like methods, variable of a class too can have another as its member writing a class within another is allowed in java. The class written within is called the nested class. and the class that holds the inner class is called the outer class. Syntax. class OuterClass { //Dater member. //Member methods class InnerClass { //data members. //member methods } } Nested classes are divided into two types: Non-static nested classes Static nested classes. Non-static nested classes(Inner Classes). Inner classes are a security mechanism in java. We know a class cannot be associated with the access modifier private. but when we have class as a member of another class, then the inner class can be made private. They are further divided into 3 types. Inner class. Met...
Educate your self.. Make each day your masterpiece.