What's the difference between inner classes and extend classes | SoloLearn: Learn to code for FREE!

+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

11/12/2016 1:36:15 AM

Smith Daniel

2 Answers

New 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

0

Smith Daniel You can read all about inner class with examples. Inner classes have some rules also please visit here: https://javagoal.com/nested-classes/