r/learnjava • u/Eva_addict • 59m ago
I need help understanding the use of "this" inside a constructor.
*Sorry if I ask too much here but books seem to get more confuse the more you go though them*
I am learning using Deitel's book and in chapter 8.5 they have an example of Overloaded Constructors. They use them in class called Time2:
public Time2()
{
this(0, 0, 0);
}This exaplain it below but I can't understand it. In fact, I didn't even know this could be used like that. The book never showed it this way. Here it looks more like a method call. There are 5 constructors like that and each one adding one more argument to this and it makes everything else even more confuse.