12/2/2019 4:59:01 PM
0 is the default value
It's null for string data type.
Byte, short, int, long, float, double are all numeric data type so how can it have a character '0' as it's default type.
Avinesh Thanks. I forgot instance variables.
I mean the variables inside a code. Just print it without initializing would not work.
and is that same with String? because char identic with string??
but i still confusing why default value of byte datatype is 0 instead of '0' !!
ok now i know, thanks
You can also look here:
Note: only static variables get default values
Denise Roßberg static and instance variables both get default values.
Here is some codes that might help you....
GET THE FREE APP
Learn Playing. Play Learning
Send us a message