Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

this() and this

Tags:

java

this

Does Java has this()?

If so, what's the difference between this and this()?

like image 568
JJ Liu Avatar asked Nov 30 '22 03:11

JJ Liu


1 Answers

this is reference to current instance. this() is call to default constructor. super() is explicit call to default constructor of super class.

like image 125
Nishant Avatar answered Dec 01 '22 15:12

Nishant