class A {
public void m(int k) {
System.out.println("class A, method m : " + ++k);
}
}
class B extends A {
public int m(int k) {
System.out.println("class B, method m : " + k++);
return k;
}
}
public class MainClass {
public static void main(String args[]) {
A a = new B();
a.m(34);
}
}
Login in to like
Login in to comment