Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class A {
- public void m1() {
- System.out.println("A m1");
- }
- }
- public class B extends A {
- public void m1() {
- System.out.println("B m1");
- }
- public void m2() {
- System.out.println("B m2");
- }
- public class Result {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- /*A a = new A();
- a.m1();
- B b = new B();
- b.m1();
- b.m2();
- */
- A ab = new B();
- ab.m1();
- }
Add Comment
Please, Sign In to add comment