.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Steve Jackman
Imran Ghani
Santhakumar Munuswamy

Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

Inheritance question?

Posted By: Jegan R     Posted Date: November 03, 2010    Points:2   Category :.NET Framework
Class A, B & C - Class A has a Save function. Class B inherits Class A. Class C inherits Class B. How will you call Save function in Class C?

Responses
Author: Asha.MP             
Posted Date: November 04, 2010     Points: 5   

H Jegan...

Please check this

Option Strict On
Option Explicit On
Public Class ClassA
Public count As Integer
Public Sub New()
count = 100
End Sub
Public Sub saveCount()
count = 200
End Sub
End Class

Public Class ClassB
Inherits ClassA

End Class

Public Class ClassC
Inherits ClassB
Public Sub New()
MyBase.New()
MyBase.saveCount()
End Sub
End Class

Public Class MainClass
Shared Sub main()
Dim classC As New ClassC

End Sub
End Class

Thanks and Regards,
Asha.mp


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend