Uninitialized class members in Java do not issue any compiler errors. local variables however do. Why?
<p>Consider the following code snippet in Java. its not going to be compiled.</p>

<pre><code>package temppkg;

final public class Main
{
    private String x;
    private int y;

    private void show()
    {
        String z;
        int a;

        System.out.println(x.toString()); // Causes a NullPointerException but doesn't issue a compiler error.
        System.out.println(y); // Works fine displaying it's default value which is zero.
        System.out.println(z.toString()); // "Cuases a compile-time error - variable z might not have been initialized.
        System.out.println(a); // "Cuases a compile-time error - variable a might not have been initialized.
    }

    public static void main(String []args)
    {
        new Main().show();
    } 
}
</code></pre>

<hr>

<p>Why do the class members (<strong>x and y</strong>) declared in the above code snippet not issue any compile-time error even though they are not explicitly initialized and only local variables are required to be initialized?</p>
