static void Main(string[] args) { VocabularyWord word1 = new VocabularyWord("happy"); VocabularyWord word2 = new VocabularyWord(null); Console.WriteLine(word1.Equals(word2)); Console.ReadLine(); }
public override bool Equals(object word) { if (word != null) { VocabularyWord that = word as VocabularyWord; return(this.Word == that.Word); } return(false); }