#6.2 Java Tutorial | Super Method

Veröffentlicht am: 02 February 2018
auf dem Kanal: Telusko
164,759
2.7k

Whenever you create the object of subclass, then it calls the constructor of subclass as well as of parent class.
-When we object of subclass by specifying the parameter, it will call specified constructor of subclass but it will call the default constructor of superclass.

Why the object of subclass always call the default constructor of super class?
Every constructor in subclass will have a by default method called as "super".
Super method is by default given by the compiler even if you do not mention it.

Super keyword:-
The super keyword in Java is a reference variable that is used to refer parent class objects.
super can be used to call parent class’ variables and methods.

Super method:-
The super keyword can also be used to access the parent class constructor by adding ‘()’ after it like super().
Super() method will directly call the constructor of superclass.
By default, complier puts the super method without parameters.
If you will pass parameters to super method, then it will call the parameterized constructor of the super class.
‘super()’ can call both parametric as well as non-parametric constructors depending upon the situation.

In this video we will see:
How to call constructors of both subclass and superclass?
Why object of subclass always call the default constructor of super class?
Super keyword
Super() method

Instagram :   / navinreddyofficial  
Linkedin :   / navinreddy20  
Discord :   / discord  

More Learning :

Java - https://bit.ly/3xleOA2
Python :- https://bit.ly/3H0DYHx
Django :- https://bit.ly/3awMaD8
Spring Boot :- https://bit.ly/3aucCgB
Spring Framework :- https://bit.ly/3GRfxwe

Servlet & JSP :- https://bit.ly/3mh5CGz
Hibernate Tutorial :- https://bit.ly/3NWAKah
Rest API | Web Service Tutorial :- https://bit.ly/38RJCiy

Git :- https://bit.ly/3NUHB3V
JavaScript :- https://bit.ly/3mkcFys
Kotlin :- https://bit.ly/3GR2DOG


Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
http://www.telusko.com/contactus


Auf dieser Seite können Sie das Online-Video #6.2 Java Tutorial | Super Method mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Telusko 02 February 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 164,759 Mal angesehen und es wurde von 2.7 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!