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
What is nested Classes? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of ac

ASP Developer- We are needed to hire an ASP developer for some urgent work. He needs to add a new page to an already prepared site; the page is already completed in HTML. He jus

Project Description: Digital invy - inventory management Main Features User friendly windows based software Multi Branch Multi company facility Multi user Integra

What are the different types of joins? 1) INNER JOIN: The Inner join shows matches only when they exist in both the tables.For example, in the SQL below there are two tabl

This is a project specifically made for shirohime. Skills required: .NET, Fashion Design, Virtual Assistant

What are advantages of SQL 2000 over SQl 7.0? 1)User-Defined Functions: The User-Defined Functions (UDFs) -- one or moreTransact-SQL statements may be used to encapsulate the

.NET is Compile Time OR RunTime Environment?   .Net's framework has CLS,CTS and CLR.CTS checks declaration of types at the time when u write code and CLS defines some rules and

Experienced Outlook addin (Microsoft Office) developer Project Description: About us in a nutshell: We are a young start-up that buys a refreshing product in the field of ent

WDS and MDT Deployment Server Training Project Description: I'm seeking someone who can Teach/Train me with MDT and WDS server. This Can be online teaching courses. I will

How can you provide an alternating color scheme in a Repeater control?  AlternatingItemTemplate Like the ItemTemplate element, but rendered for each other row (alternating item