How can inheritance is achieved in vb.net?, DOT NET Programming

How inheritance is achieved in VB.NET?

The Inheritance is achieved by using "Inherits" keyword in the VB.NET (& For C# it is ":"). Easy Sample is provided in CD for understanding inheritance in the folder "WindowsApplicationInheritance". There are 2 classes one is the parent "ClsParent" and second is the child "ClsChild". The Parent class has a string which has to parsed for junk data "@" and "/".ClsParent has the functionality which parses only cleans up "@"."ClsChild" then inherits from parent and adds some extra functionality by parsing "/".

Public Class ClsParent

 Protected strData As String = "jksdhkj@dadad///ajkdhsjakd"

 Public Function Parse() As String

 Dim PstrData As String

 PstrData = strData PstrData = Replace(PstrData, "@", "")

Return PstrData

 End Function

 Public Function GetActualString() As String

 Return strData

End Function

End Class

Public Class ClsChild

 Inherits ClsParent

 ' this is child and a special parse function is added which will also parse "/"

Public Function ParseBackSlash()

Dim PstrData As String

PstrData = Me.Parse()

PstrData = Replace(PstrData, "/", "")

Return PstrData End Function

 End Class

 Above is the source code for "ClsChild" which does the remaining work. It adds extra functionality by parsing "/" junk character's of the data.

25_interface in action.png

Figure:-Inheritance in action

Posted Date: 9/21/2012 8:53:39 AM | Location : United States







Related Discussions:- How can inheritance is achieved in vb.net?, Assignment Help, Ask Question on How can inheritance is achieved in vb.net?, Get Answer, Expert's Help, How can inheritance is achieved in vb.net? Discussions

Write discussion on How can inheritance is achieved in vb.net?
Your posts are moderated
Related Questions
Media Player App Development for Windows 8.1 platform with outstanding UI, flexible controls and simple to use. The app should be consist of 1. Normal player controls 2. s

Site minder Authentication in SharePoint We have fit site minder agent in SharePoint 2010. We would like to have incorporate with site minder agent. Currently site-minder age

What are the steps to create a windows service in VB.NET ? The Windows Services are long-running executable applications that run in its own Windows session, which then has the

Project Description: Simple task on analysis svn and github .NET, PHP, Engineering, Software Architecture

ASP Programmer I need a fixing all W3c validation errors and it is a ASP website. Have any queries please send a message and I will provide more information on project. De

What is the AppFabric component? The AppFabric component is used to make access control and dole out messages across clouds and enterprises. It has a service-oriented architect

Give a brief introduction to Binders. Binders are used by DLR to communicate with not the .NET Framework but also with a variety of other services, like Silverlight and COM. Th

hello,i want to ask that i have to make a test taker just like a quiz in vb.net which should b like mcq''z one...it must contain a connectivity with database of oracle or MS access

Explain Dataset Accept Changes and Data Adapter Update methods?  Data Adapter Update method Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated

I need Ninjatrader Strategy Project Description: UI for managing orders, entering trades. This project will probably take several months and I need dedicated resources. Sk