Can you prevent your class from being inherited and becoming
a base class for some other classes?
Answers were Sorted based on User's Feedback
Answer / guest
Yes, that?s what keyword sealed in the class definition is
for. The developer trying to derive from your class will get
a message: cannot inherit from Sealed class
WhateverBaseClassName. It?s the same concept as final class
in Java
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / srivathsan
@ guest...
the answer is not incomplete.
it is implicit. Rakesh wants to tell that the sealed
methods cannot be inherited from a class that is not
sealed, even when you inherit other members from a class
that is not decorated with the keyword sealed.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rakesh
We can also make the methods sealed.In that case ,the class
can inherit but the sealed methods in that class cannot
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / guest
Rakesh are u keeping us in Suspense?
u must complete the answer.
but the sealed methods in that class cannot........??????
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / pank
Make your class constructor as Private then it will restrict from being inherit as well as instantiate.
| Is This Answer Correct ? | 0 Yes | 0 No |
what is serilization?
What are the steps to create a webservice and consume it?
What do you know about Translate Accelerator?
If a class is having 4 variables namely type double,type integer,type string,type decimal. If we create an instance of that class those variables which gets into this instance are value types or reference types?
What is an argument in c#?
What is a collection in c#?
What are functions c#?
write program in c# using this instructions name avinash varma ,work experiance<2,nochildren his work experiance is higher than 5 years,more than one children one children name is diwakar,number of years of work eperiance at current company is the ratio of children and work experiance is 0.21 to 0.5
Hi to everybody. Lastweek i had taken an interview on c#. They ask what is boxing & unboxing, Masking.Please tell the answer and it is useful for me.
Explain how to add controls dynamically to the form using c#.net.
Do events have return type c#?
Define sealed classes in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)