January 2018
Intermediate to advanced
434 pages
14h 1m
English
A nested class can be created by just declaring the nested class inside another class. In this case, to access the nested class, you make a static reference that is like outerClass.innerClass(), and you can also make an object of inner class using this. An inner class, on the other hand, is created by adding the inner keyword to a nested class. In that case, we access the inner class as though it was a member or the outer class, that is, using an object of the outer class like this:
var outerClassObject = outerClass()outerClassObject.innerClass().memberVar
A nested class does not have access to members of the outer class, as it does not have any reference to an object of the outer class. On the other hand, the inner class ...
Read now
Unlock full access