What is the difference between super() and this() ? explain with example.
super() and this()
801
22-Jun-2018
Prakash nidhi Verma
22-Jun-2018Difference between super() and this() in java:
super() as well as this() both are used to make constructor calls. super() is used to call Base class’s constructor coz they are Parent’s class while this() is used to call current class’s constructor.We can use super() as well this() only once inside constructor.
Example super() :
Example this() :