How can inheritance is achieved in, 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, Assignment Help, Ask Question on How can inheritance is achieved in, Get Answer, Expert's Help, How can inheritance is achieved in Discussions

Write discussion on How can inheritance is achieved in
Your posts are moderated
Related Questions
It's never told  to distribute complete implementation at client, due to following shown  reasons:- 1) Anyone can use ILDASM and decrypt your logic. 2) It is a bad architectu

What is three tier architecture? The 3 tier software architecture was comes into action in the 1990s to overcome the limitations of the 2 tier architecture. There are 3 laye

SOAP Web Services A SOAP Web Service that supports three operations: add a bibliography entry, delete a bibliography entry and list all bibliography entries. You may design fo

Need a K2 Blackpearl workflows help Need a K2 Blackpearl workflows experienced developer to integrate in SharePoint 2010 and 2013. The workflow integrates with Navision 5 provid

What is the relationship between a class and an object? A class acts as a blue-print that explains the properties, states, and behaviors that are common to a number of objects.

Describe the various components in sequence diagrams. Object lifeline: - It shows the lifetime of an object creation and its destruction. If the object is created or des

What are runtime services? Runtime services having of predefined and user-defined classes that are available to the workflow runtime engine during implementation to customize t

Question: (a) List three advantages of binding data to controls. (b) The Repeater control uses templates to control formatting. Define the five types of templates supporte

Project Description: We have a reconciliation tool, written in VB.Net that selects customer data (email, addresses, etc) from three different data sources and compares them with