I'm trying to find Why am I getting' ' when I print a char variable that has been initialized with a default value '\u0000'?
I also know that float and double have default values of "0.0f" and "0.0d" , but here, when I print their default values, the suffix "f" and "d" are not printed. So why are these suffixes not printed with values?
Here is the code:
class Check{
char c;
float f;
double d;
public static void main(String a[]) {
Check obj = new Check();
System.out.println("Default value of char : " + obj.c);
System.out.println("Default value of float : " + obj.f);
System.out.println("Default value of double: " + obj.d);
}
}
char ''. float "0.0", double - "0.0". , :
'' '\ u0000' null ( - ) char? , float double, ? (, "0.0f" "0.0d" )
. : /, char?, , .
user5012346