I was just discussing about calling static methods using class name with my friend and tried out this code and expected it to throw NPE at runtime.but as it turn out it dint
Because you declare static One o; outside the main function. You can try to declare it inside the main function, it cannot even be compiled...
static One o;
main
Or you can declare it as One o = null in main, then it will be compiled but it's the same as One.method()
One o = null
One.method()