Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Java by (4k points)
Is super() used to call the parent constructor? Please explain super().

1 Answer

0 votes
by (46k points)

super() calls the parent constructor with no arguments.

It can be practiced also with arguments. I.e. super(argument1) and it will call the constructor that accepts 1 parameter of the model of argument1 (if exists).

Also, it can be applied to call methods from the sire. I.e. super.aMethod()

Added info and tutorial here

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers

500 comments

108k users

Browse Categories

...