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
The ASP.NET provides two namespaces. The first is System.WEB.mailmessage class and the second is System.Web.Mail.Smtpmail class.

Project Description: hi i need to develop a software scrapebox exect same with all Skills required: .NET, Java, C# Programming, Visual Basic, Visual Basic for Apps

The ASP.NET impersonation is totally controlled by entries in the applications web.config file. Default setting is "no impersonation". You can explicitly describe  that ASP.NET sho

How to implement DTC in .NET DTC is implemented using the COM+. Following are some of the steps to implement COM + in .NET:- 1) The "EnterpriseService" namespace has all

Program of addition of byte type variables - C# Program Program of addition of byte type variables, i need program code for performing addition of byte type variables. Can any

We would like you to develop the subsequent requirements in one plug-in already in production. The plug-in was developed in Visual Studio 2010 .NET Framework 4 C# and synchronizes

Name the binders provided by .NET Framework 4.0. .NET Framework 4.0 provides the following binders: Object Binder - Enables to communicate with .NET objects. JavaScrip

What is ASP.NET AJAX? ASP.NET AJAX, mostly called AJAX, is a set of extensions of ASP.NET. It is developed by Microsoft to execute AJAX functionalities in Web applications. ASP

Fixing chrome problem Problem 1- Booksearcha.asp and bookrstep2.asp on allreaders.com (bookrstep2 only accessible from bookrstep1.asp) utilize scroll down menus at times. In Chr

What are ASP.NET session and compare it with classic ASP session The ASP.NET session caches per user session state. It basically uses "HttpSessionState" class. The limitatio