Why do we need Static members? There are situations in which the method’s behaviour does not depend on the state of an object. So, there will be no use of having an object when the method itself will not be… Read More ›
static methods
Overriding v/s Hiding
Many people have heard that you can’t override a static method. This is true – you can’t. However it is possible to write code like this: class Foo { public static void method() { System.out.println(“in Foo”); } } class Bar… Read More ›