class Base{ static void static_func(){ System.out.println("static ---- in base...."); } void func(){ System.out.println("in base...."); } } class Sub extends Base{ static void static_func(){ System.out.println("static ---- in sub..."); } void func(){ System.out.println("in sub..."); } } public class OverrideDemo { public static void main(String[] args) { Base base = new Sub(); base.static_func(); //static ---- in base.... base.func(); // in sub... } }