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
Asp .net Facebook app project completion Project Description: We are a small development house in Singapore, and have a project which is 90 percent complete; thus our previou

This is a whole time contractual role working for a sports advisory service. We are data insights consultancy specializing in sports. We consult to a number of sporting organizatio

Explain the concept of constructor? Constructor is a special method of a class, which is called automatically when the instance of a class is formed. It is created with the sam

Explain Compare Validator and Range Validator Compare Validator uses Control To Validate, Control To Compare and operator properties to compare a control's value with another

Need Software Reconfiguration Project Description: I have a small program -exe that after selecting an item from the menu it start an .xls file and executes a security proces

Explain the concept of Web services in brief. A Web service may be explained as an independent and self-sustained unit of a software application that is hosted on the Web and i

I want help to update and customize existing POS system Project Description: We have pharmacy chain stores with existing POS system linked via VPN to server with local user o

What is Common Type System (CTS)? CTS is the component of CLR by which .NET Framework provides support for multiple languages because it have a type system that is common acros

Project Description: Looking for a developer who will develop a web portal like zulutrade, some features will be taken from signaltrader The changes would be like: 1) Only

Consumer and Dealer management Project Description: Need to code the existing UI for relative and CRUD automation. Prepare CRUD for almost 7-10 forms with search and repor