The main difference between inner class and subclass is, An Sub-Class is a class which inherits all the non-private members of its parent Class. But an inner class is a class which is nested within another class, which rights for the class which is nesting it and it can access all variables and methods defined in the outer class.
Inner classes have the methods they want, whereas sub-classes have the methods of their parent class. And Sub-classes can, of course, define additional methods, but they'll always have those of their parent.
Please log in or register to add a comment.