How can I use the inner class? I didn't get it right | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

How can I use the inner class? I didn't get it right

More explain

9th Dec 2016, 9:14 AM
mohammed alhedai
mohammed alhedai - avatar
2 Réponses
+ 2
In Java, just like methods, variables of a class too can have another class 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.
9th Dec 2016, 2:46 PM
Aditya
Aditya - avatar
+ 1
class Outer_Demo { class Nested_Demo { } }
9th Dec 2016, 2:47 PM
Aditya
Aditya - avatar