TALK IS CHEAP SHOW ME THE CODE!
class A {
public int getNumber(int a) {
return a + 1;
}
}
class B extends A {
public int getNumber(int a) {
return a + 100;
}
}
public class Bettle {
public static void main(String[] args) {
A a = new A();
System.out.println(a.getNumber(10)); // 11
a = new B();
System.out.println(a.getNumber(10)); // 110
}
}