super Keyword in Java

Three Important Usage of super keyword:

Use of super with variables: We can use super keyword to access the data member or field of parent class. It is used if parent class and child class have same fields.

Use of super with methods: It should be used if subclass contains the same method as parent class.

Use of super with constructors: super is used to invoke parent class constructor.

To get more details please watch below youtube video and Subscribe the channel.


No comments:

Post a Comment