Created
April 30, 2013 18:53
-
-
Save briangordon/5491010 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 Condiment {} | |
interface Ketchup extends ISuper {} | |
// This is a covariant interface | |
interface Kitchen<T extends Condiment> { | |
public void squirtCondiment(T covariant); | |
} | |
// This implements the Kitchen interface even though the implementation refers specifically to Ketchup in the type signature | |
class KetchupKitchen implements Kitchen<Ketchup> { | |
public void squirtCondiment(Ketchup covariant) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment