According to rule in JAVA if object reference is declared but not initialized then JAVA initializes it by null. So why is this error is occuring in my code ? Plaese help me out.
Main.java:28: error: variable obj might not have been initialized
if(obj==null)
^
class c {
int age=12;
c variable123;
}
public class A {
c obj;
if (obj==null) System.out.println(obj);
}