C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
4
Reply
Which class that cannot be inherited
Pavan Ramamurthy
12y
6k
1
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Classes which are marked as sealed at time of definition can not be inherited.
Hitanshi Mehta
7y
0
Sealed class
Kuntal Patra
12y
0
Sealed classes cannot be inherited. Class that are marked with the sealed (C#) or NotInheritable (VB.NET) keywords cannot be inherited from. This is done at the definition of the classes.The most commonly used sealed class is System.String. Abstract and Sealed Classes and Class Members (C# Programming Guide): public sealed class D { // Class members here. }A sealed class cannot be used as a base class. For this reason, it cannot also be an abstract class. Sealed classes prevent derivation. Because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster. MustInherit and NotInheritable Classes: NotInheritable Class A End Class Class B ' Error, a class cannot derive from a NotInheritable class. Inherits A End ClassA NotInheritable class is a class from which another class cannot be derived. NotInheritable classes are primarily used to prevent unintended derivation. In this example, class B is in error because it attempts to derive from the NotInheritable class A. A class can not be marked both MustInherit and NotInheritable.
ponveni
12y
0
Sealed Class
Pavan Ramamurthy
12y
0
e have an array of integers like shown below int[] arr = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 5, 9, 8, 10, 11, 12, 10, 13, ...
Which class that has Methods those cannot be inherited
Message