I would like to only implement certain interfaces within other interfaces, I don’t want them to be able to be inherited directly by a class.
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t do this in C# – any class can implement any interface it has access to.
Why would you want to do this? Bear in mind that by declaring an interface inheritance:
You’re specifying that anything implementing
InterfaceBalso has to implementInterfaceA, so you’ll get classes implementingInterfaceAanyway.