Hai friends what is the difference between sealed class and private constructor any way both doesnt allow inheritance? If any difference please tell me?
BhuvanRam
0
Newbie Poster
Recommended Answers
Jump to PostHai friends what is the difference between sealed class and private constructor any way both doesnt allow inheritance? If any difference please tell me?
Let me takes a shot at this ...
A sealed class doesn't allow inheritance. That is, you can't derive from it.
A private constructor …
Jump to PostSealed classes
A sealed class cannot be used as a base class. For this reason, it also cannot be an abstract class. Sealed classes are primarily used to prevent derivation. They add another level of strictness during compile-time, improve memory usage, and trigger certain optimizations that improve run-time efficiency.
All 5 Replies
Zinderin
11
Junior Poster in Training
Alexpap
1
Junior Poster
pritesh2010
30
Posting Whiz in Training
Ketsuekiame
860
Master Poster
Featured Poster
BhuvanRam
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.