Created
January 11, 2017 08:26
-
-
Save richard-ejem/3b7cfc8ef95a96befa48f9bc36be5b01 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
public class HelloWorld | |
{ | |
public static void main(String[] args) | |
{ | |
A b = new B(); | |
foo(b); | |
A a = new A(); | |
foo(a); | |
B really_b = new B(); | |
foo(really_b); | |
} | |
private static void foo (A arg) { | |
System.out.println("Aaaa"); | |
} | |
private static void foo (B arg) { | |
System.out.println("Beee"); | |
} | |
} | |
class A {} | |
class B extends A {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment