Last active
December 22, 2016 11:35
-
-
Save c0rp-aubakirov/8ce52251a06adb9633c6d4aaa7edb84a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* User: Sanzhar Aubakirov | |
* Date: 12/22/16 | |
*/ | |
public class Test { | |
public static void main(String[] args) { | |
Child c = new Child(); | |
c.A(); | |
} | |
public static class Parent { | |
public void A() { | |
System.out.println("In Parent A. Calling B"); | |
this.B(); | |
} | |
public void B() { | |
System.out.println("In Parent B"); | |
} | |
} | |
public static class Child extends Parent { | |
@Override | |
public void A() { | |
System.out.println("In Child A. Calling Parent A"); | |
super.A(); | |
} | |
@Override | |
public void B() { | |
System.out.println("In Child B"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment