Skip to content

Instantly share code, notes, and snippets.

@richard-ejem
Created January 11, 2017 08:26
Show Gist options
  • Save richard-ejem/3b7cfc8ef95a96befa48f9bc36be5b01 to your computer and use it in GitHub Desktop.
Save richard-ejem/3b7cfc8ef95a96befa48f9bc36be5b01 to your computer and use it in GitHub Desktop.
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