Last active
August 29, 2015 14:08
-
-
Save RainWarrior/5036242f033e24ccde9a 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 I { | |
public int x(); | |
} | |
class IImpl { | |
public int y() { | |
return 3; | |
} | |
} | |
class A implements I { | |
public int x() { | |
return 4; | |
} | |
} | |
public class Main { | |
public static <F,T> T convert(F obj) { | |
//return (T)(Object)obj; | |
return null; | |
} | |
public static void main(String[] args) { | |
A a = new A(); | |
//IImpl i = (IImpl)(Object)a; | |
IImpl i = convert(a); | |
System.out.println(i.y()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment