2 Answers
+ 2
I do not understand your doubt because if you can understand that the integer value can have a default value 0, considering that you know it then why cannot short? Both are integer type numeric values which have a default value of 0. Also that code is not right, because a variable in local scope has to be initialized before it is used. So kindly make an instance or a class variable, which is declared outside the main() to find out it's actual default value. See if this helps- https://code.sololearn.com/cM37TivtXr3p/?ref=app
28th Jan 2020, 1:36 PM
Avinesh
Avinesh - avatar
0
Avinesh i do that instance variables have default values but it was'nt mentioned in the question about instance varibale . So i got confused.!
28th Jan 2020, 1:43 PM
Shubham kumar
Shubham kumar - avatar