I thought you can not override static method in Java but its not a compile time error to declare exactly same method in sub class, That is called method hiding in Java. But what if i have to override static method.
// filename Test.java
public class Test {
public static void foo() {
System.out.println("Test.foo() called ");
}
public static void foo(int a) {
System.out.println("Test.foo(int) called ");
}
public static void main(String args[]) {
Test.foo();
Test.foo(10);
}
}