Interfaces: Lesser known facts!

  • Using interface references, you can access private methods of a class. That is, if your class has got any private methods which in turn are a part of an interface implementation, then they can be accessed using interface references. If you recollect, the interface definition does not include access specifiers.
  • Interface references can also be used on Value types (structures etc). But note that, the methods would be called on the boxed version of the values.

Leave a Reply

Your email address will not be published. Required fields are marked *


*