Sunday, April 06, 2025

LATEST UPDATES
>> What is the difference between continue and break statement?  >> What is a singleton class? Give a practical example of its usage.  >> What’s the purpose of Static methods and static variables?  >> What are the various access specifiers for Java classes?  >> What is the difference between an Inner Class and a Sub-Class?    

Friday, 18 November 2016

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

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.

No comments:

Post a Comment

Designed By Seo Blogger Templates