+ 2
Why should I use constructor, if I can use simple method to set an attribute value?
3 Answers
+ 5
U have to call a method but in the case of a constructor it gets called automatically when you create the object.
0
@Utkarsh Barsaiyan thank you, now I understand!
0
Thanks