The "new" keyword as you are using it creates a new object of type CaseInsensitiveComparer() and then calls the method Compare(y,x) and then returns the int value. When you call "new" keyword as a modifier that hides a method below it you have to use it in
the method line along with the other describes such as what it returns, if it is "public" or not, and many others. I think you may be confused on what the "new" keyword does. Interfaces do not have constructors because they are not objects they are just a
set of predefined methods that can be called. Interfaces are most useful for objects that might not always be of the same type but if they have the same interface than a method can access any object of any type as long as it supports the interface. In addition
interface methods always have to have public methods and must have all methods displayed publicly by the class that is using them. I don't know if I told understood the second part of you questions.
Participant
792 Points
2233 Posts
Re: working with interfaces
Jan 06, 2004 08:43 AM|nberardi|LINK