Java Tutorials: Usage of 'super' keyword in Method | Constructor | Variable

Опубликовано: 10 Октябрь 2024
на канале: Coding Simplified
805
8

'super' keyword:
When we need to access the super class method or variable, we need 'super' keyword.
Can be applied on method, class & variable

Method:
call using super.methodName() as first statement in subclass method

Variable:
For accessing super class variable:
super.variableName
i.e super.x = 5;

Constructor:
By default, sub class always calls the constructor of super class. i.e super()
If it's parameterized constructor, then you need to explicitely call the super call constructor by 'super(var)';
It should be first statement of method.

Do watch video for more info.

This problem is similar to following:
super keyword in java,
what is super keyword in java,
super keyword java,
super keyword,
super in java,
how to call base class method,
how to call base class constructor,
java tutorial,
coding simplified,
java

CHECK OUT CODING SIMPLIFIED
   / codingsimplified  

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 300+ videos. My account is Partner Verified.

★☆★ VIEW THE BLOG POST: ★☆★
http://codingsimplified.com

★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★

https://www.youtube.com/codingsimplif...

★☆★ SEND EMAIL At: ★☆★
Email: [email protected]