Based on program below I am confused whether null is an object because my program compiles fine with out any error. I thought it will give a null pointer exception as I am passing null at line 1
public class GC {
private Object o;
private void doSomethingElse(Object obj)
{
o = obj;
System.out.println(o); // prints null
}
public static void main(String[] args) {
GC g = new GC();
g.doSomethingElse(null); // LINE 1
}
}