3 ms·
Yes, if the method is not explicitly implemented then you can call it without going through the interface. But at that point it's just a regular method that mi
by noblethrasher 13y ago
Yes, if the method is not explicitly implemented then you can call it without going through the interface.
But at that point it's just a regular method that might also happen to implement part of an interface that you the programmer are not using (at least at that point).
Likewise in the case of foreach, the compiler is looking for a particular method and does not need to care whether or not that method happens to also implement part of an interface, so there is not point in making the programmer go through the trouble of marking the type as such.