According to the MSDN document interface can be a member of a class or namespace :
for Example i can declare:
public class Test
{
public interface IMemberofTest
{
void get();
}
}
What is the use of having interface inside a class? Won't it break the purpose of real interface usage?
The class is another namespace. Therefore the interface can be used to enforce contracts on data that flows between methods in the class, or just to scope the interface more precisely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With