Posts

Showing posts with the label super constructor

Java super Keyword (super variable, super method, super constructor)

Image
Java super Keyword: super Variable, super Method, super Constructor (With Examples) ✨ Quick Summary In this post, you’ll learn what the super keyword means in Java and why it is used. We will cover super variable , super method , and super constructor with beginner-friendly examples. Java super keyword Inheritance In our previous posts, we learned about Inheritance , Polymorphism , and the this keyword. Now, let’s learn another keyword that is used mainly in inheritance: super . 1) What is super Keyword in Java? The super keyword in Java refers to the parent class object . ✅ Simple meaning: super = parent class reference 2) Why Do We Use super Keyword? We use super keyword mainly for: ✅ To access parent class variables ✅ To call parent class methods ✅ To call parent class constructor 3) super Keyw...