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 strong-typing versus weak-typing? Which is preferred? Why? Strong type is checking the types of variables as soon as possible, usually at compile time. While weak typing

What does Xml Validating Reader class do? The XmlTextReader class does not validate the contents of an XML source against a schema. The correctness of the XML documents can be

What is the Scope of public/private/friend/protected/protected friend? Scope of public/private/friend/protected/protected friend Visual Basic/Visual C# Public/public all

The Full form of CLR is Common Language Runtime and it is  the heart of the .NET framework. All Languages have its own runtime and its the responsibility of the runtime to take car

What are basic methods of Data adapter? The three most commonly used methods of Dataadapter are as follows:- 1)Fill :- It Executes the SelectCommand to fill the DataSet ob

Virtual Webcam effects + Sourcecode + Setup + Nice User Interface Project Description: i want a similar webcam effects application which can apply effects to webcam feed. So

What is code access security (CAS)? Code access security (CAS) is part of the .NET security model that stops unauthorized access of resources and operations, and restricts the

VB.NET Questions Project Description: Need help to solve questions of VB.NET Skills required: .NET, Software Development, C# Programming, Visual Basic, Windows Deskt

What is the main difference b/w MSML and .NET Framework XML classes? The MSXML supports XML DOM and SAX parsers while the .NET framework XML classes support XML DOM and XML rea

What is the significance of Finalize method in .NET? The .NET Garbage collector does atmost all clean up activity for your objects. But unmanaged resources (like - Windows API