private static void staticMethod() { System.out.println("static method"); }
Is there a difference between calling a static method like:
without class name
staticMethod();
Vs:
with class name
demo.staticMethod();
Vs
demo obj = null; obj.staticMethod();
Vs
demo obj = new demo(); obj.staticMethod();