What are Sealed Classes in C#?
Answers were Sorted based on User's Feedback
when a class defined as sealed its not possible to inherit
its class and properties to the inherited class.Its also
applicable to the class properties.Even class defined as
public its banned to inherit the class.
| Is This Answer Correct ? | 126 Yes | 18 No |
Answer / vijay rana
if we want to prevent a class to be inherited then we use
the keyword sealed,
means this class will not be inherited now
| Is This Answer Correct ? | 117 Yes | 12 No |
Answer / sasi
A sealed class cannot be used as a base class. For this
reason, it cannot also be an abstract class.
| Is This Answer Correct ? | 83 Yes | 17 No |
Answer / nitin kumar tomar
A Class that cannot be inherited and used by the other
classes
| Is This Answer Correct ? | 76 Yes | 15 No |
Answer / kanchan kora
A class which restricts inheritance for security region is
called Sealed class.
Sealed class is the last class in hierarchy.
Sealed class can be a derived class but can't be a base class.
To access the members of sealed class we should create the
instance object.
Advantages of sealed class is it restrict the third party
vendor for developing new software by inheriting from our logic.
| Is This Answer Correct ? | 50 Yes | 9 No |
Answer / irfan
Sealed classes cannot be inheritted by parent class and
sealed methods cannot be ovrriden
| Is This Answer Correct ? | 24 Yes | 18 No |
Answer / prabhakaran
A derived class can stop virtual inheritance
| Is This Answer Correct ? | 4 Yes | 0 No |
Which class comes after the SortedList class?
Method1() { int a=0, b=0, c=0; Monitor.Enter(this) c = 12; b = 3; a = c/b Moniter.Exit(this) } Method1() { int a=0, b=0, c=0; c = 12; b = 3; lock(this){ a = c/b } } Choose correct answer. a. Upon completion, Method1 and Method2 release the lock b. Upon Comletion, Method1 release the lcok and Method2 not. c. Upon Completion, Method2 release the lock and Method1 not. d. Upon Completion, neither Method1 or Method to release the lock.
Are classes passed by reference in c#?
why instance? what are the uses of instance?
So what makes your code really object-oriented #?
How?s method overriding different from overloading?
who is a protected class-level variable available to?
Can you have more than one namespace in c#?
What is the difference between yield and return?
What is a dll in c#?
What is the difference between decimal and integer?
What is Satellite Assemblies ?
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)