While studying C# in ASP.net I have trouble understanding several classes. In which scenario should I use the following classes private,public,protected,abstract,static,sealed ?
It would be better if someone can explain these with easy examples.
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.
Those are not classes.
private,protectedandpublicare access modifiers. They indicate which other code can see the code they affect:An
abstractclass is one that may containabstractmembers. Anabstractmember has no implementation, so all derived classes must implement theabstractmembers.A
sealedclass cannot be inherited. Astaticclass issealed, but also can only containstaticmembers.I suggest you start with “Getting Started with Visual C#. This is a very basic question.