Variables that are declared as a class member variable, be static or instance, and not assigned a value will be assigned their default value. Note defaultValue is a static class member variable.
It's not always necessary to assign a value when a field is declared. Fields that are declared but not initialized will be set to a reasonable default by the compiler. Generally speaking, this default will be zero or null, depending on the data type. Primitive Data Types
The default values that will be assigned are as follows.

Of the four primitive types given (double, int, long and short), each will be assigned with 0, however, the output depends on how the primitive type is converted to a String. The way in which a String is generated from a primitive is almost identical, just with distinct methods for each primitive type. Let's examine the int primitive type:
By calling System.out.println(int i)
you effectively call System.out.print(int i)
with a line.separator
used to terminate the line, as described in the PrintStream documentation. The System.out.print(int i)
method takes the string produced by String.valueOf(int i)
which is translated into bytes according to the platform's default character encoding. Finally, the String documentation shows that String.valueOf(int i)
acts as a wrapper for Integer.toString(int i)
Hence, the String value for a primitive type is generated found by invoking the toString() method with the primitive value as a parameter on the wrapper Class corresponding to the primitive type (Integer for int, Short for short, etc).
How do these methods convert their default value to a String? All of the primitive values in the question (double, int, long and short) are assigned a default value of 0 (0.0d for double). The toString(primitive_type value)
for each of the wrapper classes state that:
Double :
if m is zero, it is represented by the characters "0.0"; thus, negative zero produces the result "-0.0" and positive zero produces the result "0.0". toString(double d)
Integer :
Returns a String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and radix 10 were given as arguments to the toString(int, int) method. toString(int i)
If the magnitude is zero, it is represented by a single zero character '0' ('\u0030') toString(int i, int radix)
Long :
Returns a String object representing the specified long. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and the radix 10 were given as arguments to the toString(long, int) method. toString(long i)
If the magnitude is zero, it is represented by a single zero character '0' ('\u0030') toString(long i, int radix)
Short :
Returns a new String object representing the specified short. The radix is assumed to be 10. toString(short s) Note that inspecting the code shows that this method is simply a wrapper for return Integer.toString((int)s, 10);
Hence, int, long and short will all output the character '0' when the value is 0 whereas the double value will print the characters '0.0'.