Since static functions belong to a class, they are inherited but not overridden, merely hidden. From the code below, it seems that the woof method in B can only have a "throws IOException" declaration if the parent method also has it. I.e the below code gives a compiler error that the throws clause is not compatible with the one in A.woof If the method is not being overridden, why must it satisfy the exception contract ?
class A {
static void woof() { //Compiles IF i add throws IOException here
System.out.println("A's woof");
}
}
class B extends A {
static void woof() throws IOException { //Compiler error
System.out.println("B's woof");
}