Created
April 29, 2015 09:05
-
-
Save z-a-ki3/0570c48f06df0decd731 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
interface Z { } | |
class Y extends X { public String toString() { return "Y"; } } | |
class X implements Z { public String toString() { return "X"; } } | |
public class Test { | |
public static void main(String[] args) { | |
Y y = new Y(); | |
X x = y; | |
Z z = x; | |
System.out.print(x + " "); | |
System.out.print((Y)x + " "); | |
System.out.print(z + " "); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment