Abstract classes, DOT NET Programming

What are abstract classes?

The features of the abstract class are as follows:-

1.     You can not create an object of the abstract class.

2.     The Abstract class is designed to act as a base class (to be inherited by another classes). In the program development  the Abstract class is a design concept and provides a base upon which other classes are built.

3.     The Abstract classes are similar to the interfaces. After declaring an abstract class, it can't be instantiated on its own, it must be inherited.

4.     In VB.NET abstract classes are created by using the "MustInherit" keyword.In the C# we have "Abstract" keyword.

5.     The Abstract classes can have implementation or pure abstract methods which must be implemented in the child class.

Public MustInherit Class ClsAbstract

' use the mustinherit class to declare the class as abstract

Public Function Add(ByVal intnum1 As Integer, ByVal intnum2 As

Integer) As Integer

Return intnum1 + intnum2

End Function

' left this seconf function to be completed by the inheriting class

Public MustOverride Function MultiplyNumber(ByVal intnum1 As

Integer, ByVal intnum2 As Integer) As Integer

End Class

Public Class ClsChild

Inherits ClsAbstract

' class child overrides the Multiplynumber function

Public Overrides Function MultiplyNumber(ByVal intnum1 As

Integer, ByVal intnum2 As Integer) As Integer

Return intnum1 * intnum2

End Function

End Class

1945_abstract classes.png

Posted Date: 9/21/2012 8:50:41 AM | Location : United States







Related Discussions:- Abstract classes, Assignment Help, Ask Question on Abstract classes, Get Answer, Expert's Help, Abstract classes Discussions

Write discussion on Abstract classes
Your posts are moderated
Related Questions
Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

having trouble programming

I need Simple upgrades for ASP.NET site I have an existing web solution, we need a new page for creating additional features. The current website is done in C#.NET and ASP.NET.

I need Job Posting Software for Schools Project Description: I want to create a software program that will automatically post a job to multiple schools. Let me know if you

What is the difference between the Take and Skip clauses? The Take clause returns a specified number of elements. For instance, you can use the Take clause to return two values

Accepting a List of 5 Items - C# Program Hello, I've been trying so many codes for this but those codes didn't work well. Please write the code for Accepting a List of 5 Items

Project Description: We require an expert developer to work on several projects for our company. You will be managed by our senior developer. Required - MUST be proficient in

What do you understand by SOAP encoding? The Serialization of the types, such as integers and strings, inside a SOAP message is known as encoding. The SOAP objects use XML elem

MAT LAB programming Project Description: i have simulation and i need to simulate the equation in ,and test the all simulation it working with your work program other code sh

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