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
What is the main difference between Gridlayout and FlowLayout? The Grid Layout provides absolute positioning for the controls placed on the page. The Developers that have their

Differences between Datagrid, Datalist and Repeater?   1. Datagrid has paging whereas Datalist doesnt. 2. Datalist has a property called repeat. Direction = vertical/horizon

I want a Panel for youtube views and facbook likes. I need a panel made that can increase facebook fanpage likes, and that will increase youtube video views. Youtube views an

I need Programmer to extracting data Project Description: Programmer role A skilled programmer is required to build a standalone module to extract, parse and store in data

The steps that occur when we request a ASPX page are as follows:- 1) The browser sends the request to the webserver. Now  assume that the webserver at the other end is IIS. 2

#queWrite a XML with database with book details (BOOK ID, Title, Author, subject, published Year, language, vendor, price)stion..

I am looking for someone to work on his website via team viewer. First I would want you to fill up this. On a scale from 1 - 10 please grade the following skills- C# - AJ

Print Floyd's Triangle - C# Program I am unable to make out how to print Floyd's Triangle in C# language. Can anyone suggest me any example for this.

What are the metrics followed in project management? The most metric sets deal with a variation of these attributes and are chosen to help the project managers gain insight int

Howto create a simple stylesheet for a web application