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 Object Oriented Programming? This is a problem solving process to develop software systems. This is a technique to think real world in terms of objects. The Object maps

What is Query String and what are their benefits and limitations? The query string is the information sent to the server appended to the end of a page URL. The benefits of u

Give a brief introduction on side-by-side execution. Can two applications, one using private assembly and the other using the shared assembly be stated as side-by-side executables?

How can we know a state of a thread? The "ThreadState" property is used to get complete detail of a thread. The Thread can have one or a combination of status.System.Threading.

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Textilepro.frmLogin.resources" was correctly embedded or linked into assembly

hello,i want to ask that i have to make a test taker just like a quiz in vb.net which should b like mcq''z one...it must contain a connectivity with database of oracle or MS access

Explain Component diagrams Package: - The Package logically make group of element of a UML model. Component: - It is the actual physical module or implementation of

As you have probably realized by now, Web pages are much more useful when they are dynamic. In Internet terminology, the word dynamic means several things. Primarily, it refers to

Project Description: Looking for an internal-use, Manufacturing/ ERP Website developed for use at a Paper Mill. Modules/areas would include Customers, Scheduling, Sales Orders,

What is a parameter? Explain the new types of parameters introduced in C# 4.0. A parameter is a special type of variable, which is used in a function to give a piece of informa