How come Java initializes variables for you?
<pre><code>public class test {
    public static void main(String[] args) {
        int MAX = 5;
        boolean bit[] = new boolean[MAX];
        float[] value = new float[2*3];
        int[] number = {10, 9, 8, 7, 6};
        System.out.println(bit[0]); // prints “false”
        System.out.println(value[3]);   // prints “0.0”
        System.out.println(number[1]);  // prints “9”
        }
    }
</code></pre>

<p>I'm testing out the above code, how come Java would initialize the values for you? I thought it should throw compilation error if I don't initialize my variables. Also, what should I do to the line <code>float[] value = new float[2*3];</code> if I want to initialize them all to 0.0?</p>
