What is the difference between super() and this()?
introduction to programming oracle dba training java se 8 programming itil service operation training
Printable View
What is the difference between super() and this()?
introduction to programming oracle dba training java se 8 programming itil service operation training
super() as well as this() both are used to make constructor calls.
super() is used to call Base class's constructor(i.e, Parent's class) while this() is used to call current class's constructor.
If you use this() and super() together in a constructor it will give compile time error.
super() as well as this() both are used to make constructor calls.
super() is used to call Base class's constructor(i.e, Parent's class) while this() is used to call current class's constructor.
super() is used to call Base class's(Parent class's) constructor.
Thanks for show your interest