Skip to content

Instantly share code, notes, and snippets.

@z-a-ki3
Created April 29, 2015 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z-a-ki3/b7dee9f905e1942d2715 to your computer and use it in GitHub Desktop.
Save z-a-ki3/b7dee9f905e1942d2715 to your computer and use it in GitHub Desktop.
class X { }
interface A { }
class Y extends X implements A {
void show() { System.out.println("Hello"); }
}
public class Test {
public void main(String[] args) {
X x1 = new X();
X x2 = new Y();
((Y)x2).show();
((A)x1).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment