Skip to main content
1 of 2

Static method in inheritance

class A { static{ get(); } static void get(){ System.out.println("HELLO"); } } class B extends A { public static void main(String[] args) { } } 

Ouput -
HELLO
How is static method of class A getting called.I can understand static method of B geting called but not of A.