Skip to content

Instantly share code, notes, and snippets.

@briangordon
Created April 30, 2013 18:53
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 briangordon/5491010 to your computer and use it in GitHub Desktop.
Save briangordon/5491010 to your computer and use it in GitHub Desktop.
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