Created
August 16, 2017 15:59
-
-
Save alexandreaquiles/7eb3d21b9a41df0b93a6d962260cbde9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class A { | |
static int x() { | |
return 1; | |
} | |
} | |
class B extends A { | |
static int x() { | |
return 2; | |
} | |
} | |
A a = new A(); | |
B b = new B(); | |
A ab = new B(); | |
a.x(); //1 | |
b.x(); //2 | |
ab.x(); //1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment