In C#, how many classes can you inherit from?
When you write:
using System.Web.UI;
is that considered inheriting from a class?
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.
A using directive:
only means that if an identifier isn’t in the local namespace, the namespace
X.Y.Zwill be searched for that identifier as well. This allows you to have somewhat terser code, so you don’t have to doSystem.IO.Path.Combine()if you haveusing System.IO.Path, for instance. I don’t believe there is a limit on how manyusingstatements you can have.C# does not allow multiple inheritance — you can only inherit from one class. However, you can implement as many interfaces as you’d like.