Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

abstract class

Former Member
0 Kudos

Hi to all,

can any one tel me what are abstract classes and what hapens if i check the ABSTRACT ckeck box while creating a interface in se24(class builder)?

Thanks & Regards

Priya

1 ACCEPTED SOLUTION

asik_shameem
Active Contributor
0 Kudos

Hi,

Abstract class is the class in which there is at least one abstract method.

Abstract method is the method which does not have any body defined in that class.

We cannot create any object of the abstract class. So, that abstract class must be derived by the subclass which defines all the abstract methods of the super class.If the sub class doesn't define any abstract method of the super class, then that sub class automatically becomes the abstract class.

Classes with at least one abstract method are themselves abstract.

Static methods and constructors cannot be abstract.

6 REPLIES 6

asik_shameem
Active Contributor
0 Kudos

Hi,

Abstract class is the class in which there is at least one abstract method.

Abstract method is the method which does not have any body defined in that class.

We cannot create any object of the abstract class. So, that abstract class must be derived by the subclass which defines all the abstract methods of the super class.If the sub class doesn't define any abstract method of the super class, then that sub class automatically becomes the abstract class.

Classes with at least one abstract method are themselves abstract.

Static methods and constructors cannot be abstract.

Former Member
0 Kudos

Abstract classes r those which cannot b instantiated..means u cannot create an object for those classes..

If u check ABSTRACT in SE24..u specify tht u cannot create objects for dat class..

Hope dis helps..

Reward if it does

meikandan_krishnan2
Participant
0 Kudos

Hi ,

Please find below the points ,

1. There will not be any check box to make a class abstract.

You a select it only from the Dropdown list box.

2. While creating Interface you can find only one check box as only modelled.

Abstract clas:

1.You cannot instantiate objects in an abstract class. This does not, however, mean that references to

such classes are meaningless. On the contrary, they are very useful, since they can (and must) refer

to instances in subclasses of the abstract class during runtime. The CREATE-OBJECT statement is

extended in this context. You can enter the class of the instance to be created explicitly:

CREATE OBJECT <RefToAbstractClass> TYPE <NonAbstractSubclassName>.

2.Abstract classes are normally used as an incomplete blueprint for concrete (that is, non-abstract)

subclasses, in order to define a uniform interface, for example.

3.Abstract instance methods are used to specify particular interfaces for subclasses, without having to

immediately provide implementation for them. Abstract methods need to be redefined and thereby

implemented in the subclass (here you also need to include the corresponding redefinition statement

in the DEFINITION part of the subclass).

4. Classes with at least one abstract method are themselves abstract

5.Static methods and constructors cannot be abstract (they cannot be redefined).

Former Member
0 Kudos

Hi Priya,

I haven't seen any checkbox for ABSTRACT while creating interface in SE24.

It is the dropdown list which is available.

Anyway, ABSTRACT classes cannot be instantiated, i mean they have only definition part they don't have any impletementation part.

Regards,

Chandru

matt
Active Contributor
0 Kudos

>

> Anyway, ABSTRACT classes cannot be instantiated, i mean they have only definition part they don't have any impletementation part.

Not entirely correct. An abstract class has at least one method that doesn't have an implementation. But it may, and probably will have, several methods that do.

matt

0 Kudos

Thanks Matthew .

Thanks & Regards

Priya

Edited by: priya latha on Dec 19, 2007 11:43 AM