Last active
December 17, 2015 11:48
-
-
Save leonmaia/5604486 to your computer and use it in GitHub Desktop.
Exemplo1 de Contravariancia
This file contains hidden or 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
void CompareDog(IComparer<dog> comparer) { | |
var dog1 = new Dog("Logan"); | |
var dog2 = new Dog("Wolverine"); | |
if (comparer.Compare(dog2, dog1) > 0) | |
Console.WriteLine("Wolverine ganhou!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment