Tony Smith wrote:
No, it will tell you that you can't access a non-static variable in a static context. It won't say anything about it not being initialized.
Member variables get default values at object instantiation, so it's not a compile time error to read those variables before explicitly initializing them, though it will often lead to undesirable results at runtime, such as NullPointerException.
Local variables, on the other hand, do not get any default values, so we have to assign a value to a local before we can read it.