in JAVA by
What is the difference between an Inner Class and a Sub-Class?

1 Answer

0 votes

An Inner class is a class which is nested within another class. An Inner class has access rights for the class which is nesting it and it can access all variables and methods defined in the outer class.

A sub-class is a class which inherits from another class called super class. Sub-class can access all public and protected methods and fields of its super class.

Related questions

0 votes
asked May 5, 2021 in JAVA by SakshiSharma
0 votes
asked Dec 7, 2020 in JAVA by SakshiSharma
0 votes
asked Jun 16, 2019 in JAVA by reins.robin