What is the equivalent of Sealed Class in VB.Net?

 Posted by vishalneeraj-24503 on 11/2/2014 | Category: OOPS Interview questions | Views: 7693 | Points: 40

NotInheritable keyword is an equivalent of Sealed Class .
For Ex:-
Public NotInheritable Class Credit

Private Sub New()
'Constructor Initialization
End Sub
End Class

For Example:-
NotInheritable Class S1 

'do your code
End Class

Class S2
Inherits S1

When derive a class from S1 then will get below error:-
S2 cannot onherit from class 'S1' because 'S1' is declared 'NotInheritable'

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response