What is difference between subclass and inner class in Java?

inner classes are in the same file, whereas subclasses can be in another file, maybe in another package . You cannot get an instance of an inner class without an instance of the class that contains it. inner classes have the methods they want, whereas subclasses have the methods of their parent class.

Sizin İçin Seçtik  What is part of relationship in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *