RSS

Abstract Class

17 Jul

The class which can not be instantiated is known as an Abstract Class. This particular article contains the details of an Abstract Class.

Introduction

The class which cannot be instantiated is known as an Abstract Class. That is, an object of it cannot be created. Hence it must be inherited. Let me cite some of the features of an Abstract Class.

Features of an Abstract Class

1. Abstract Class cannot be instantiated.
2. An Abstract Class must be inherited.
3. It may have Concrete Methods.
4. It may have Abstract Methods.
5. An Abstract Method of an Abstract Class must be overridden.
6. An Abstract Class can only contain Abstract Method.

Abstract Class cannot be instantiated.

Error Message

It must be inherited

Output

Abstract Class may have Concrete Method

Output

Abstract Class may have Abstract Method

Error Message

An abstract method of an abstract class must be overridden

Output

An Abstract Method can be present only in Abstract Class

Error Message

Hope this article will be useful.
Thanks!
Advertisements
 
Leave a comment

Posted by on July 17, 2011 in Basic Concepts of oop

 

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: