Created
November 6, 2015 08:47
-
-
Save pulsation/056cfff64aa05045a4c7 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
class App { | |
public static class SuperClass {} | |
public static class SubClass extends SuperClass {} | |
public static <T, U extends T> U returnSub(T sup, U sub) { | |
return sub; | |
} | |
public static void main(String[] args) { | |
SuperClass parent = new SuperClass(); | |
SubClass child = new SubClass(); | |
returnSub(parent, child); | |
returnSub(child, parent); // Java doesn't like that | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment