Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 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!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...