Constructors using THIS to Call Other Constructors - Java Tutorials be Example - APPFICIAL

preview_player
Показать описание
The this keyword can be used inside the constructor to call another overloaded constructor. The preferred pattern is to put all the constructor code in the largest constructor (most parameters), and call it from the smaller constructor
Рекомендации по теме
Комментарии
Автор

You make understanding Java so simple! Big thanks! Great work!

I_O_O_I
Автор

I do not know who you are, but your videos truly stand out! Yours explain much much better than the rest of the "tutorials" with catchy thumbnails. 

Thank you!

hrachbarseghyan
Автор

Omg THANK YOU SO MUCH!!!! Exercise was asking for a call in the default constructor and I had no idea how to do that or what it meant! Spent hours searching for help and trying different things! THANK YOU!!!

thenorsenut
Автор

Please SUBSCRIBE! More programming videos coming soon! ✌️

Appficial
Автор

Why would you want to have a constructor call on another? You can just make two consrtuctors with different params, and use whichever one you need right? I dont understand the point in calling a constructor with another one. Please shed some light on this. Thank you!!

benh