What's the difference between inner classes and extend classes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What's the difference between inner classes and extend classes

the two kind of classes are all based on their parent classes so what's the difference between them ?is there any different functions they

12th Nov 2016, 1:36 AM
Smith Daniel
Smith Daniel - avatar
1 Answer
+ 1
The extended classes inherits all the methods, functions and properties of the super class you have chosen. It's possible to create independent instances of it. The inner classes are "helpers" of the class. I think they are commonly declared private and very rarely public, 'cause they can be useful only for the class they are declared in. An inner class is used sometimes to handle events of objects, but personally I've never had the need of them yet. Due to their rarity I can't explain more about inner classes, check this doc: https://goo.gl/DqtkVs
12th Nov 2016, 6:24 AM
Gleb Golov
Gleb Golov - avatar