How would you implement inheritance using VB.NET/C#?

Showing Answers 1 - 2 of 2 Answers

Sunitha

  • May 31st, 2005
 

By using inherits keyword v can implement inheritance 
and only single level multiple level and hybrid inheritance is supported in vb.net

  Was this answer useful?  Yes

Iyyappan

  • Jul 20th, 2005
 

There are two types are inheritence. 
1) Multiple Inheritence. 
2) Multilevel Inheritence. 
 
.NET Supports only Multilevel Inheritence.  
 
Ex: 
 
Public Class ParentClass 
Public Overridable Sub OIverridingMethods() 
Messagebox.Show ("Message From ParentClass") 
End Sub 
End Class 
 
Public Class ChildClass Inherits ParentClass 
Public overrides Sub OverridingMethods() 
MessageBox.Show ("Message From ChildClass") 
End sub 
End Class. 
 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions