Why is it printing 0 0? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
16th Mar 2019, 7:15 AM
Alex
Alex - avatar
3 Answers
+ 3
Thanks ~ swim ~ 😊
16th Mar 2019, 8:04 AM
Alex
Alex - avatar
+ 2
Because by default variable values is zero means it doesn't give any garbage value it is only in java if it is c++ then it gives garbage value
16th Mar 2019, 6:53 PM
Abhishek Yadav
+ 1
you would need to do this.a = a; and this.b = b;
16th Mar 2019, 3:00 PM
Reece
Reece - avatar