Application Development and Automation 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: 
Read only

interface and class

Former Member
0 Likes
771

Hi every one, I'm a new abaper. Can anyone explain me what is interface and what is class, and, what's the difference between them? Thanks!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
739

HI

well here it is

interface is the place where data get excahnged

also interface do not have any code in it.

it have the defiantion of method and defined import export parementers

its the class which impliments the interface .

means which write the code as per the defination for that interface and pass the impoert ex[pot partameter

Chees

Snehi

6 REPLIES 6
Read only

Former Member
0 Likes
739

Hi,

Basic difference is , A class can have a object but interface cannot have.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
739

Just read http://help.sap.com

Regards,

John.

Read only

Former Member
0 Likes
740

HI

well here it is

interface is the place where data get excahnged

also interface do not have any code in it.

it have the defiantion of method and defined import export parementers

its the class which impliments the interface .

means which write the code as per the defination for that interface and pass the impoert ex[pot partameter

Chees

Snehi

Read only

0 Likes
739

Hi,

In another words,

Interface is just a common place where we store some methods and events ( without logic )

This interface can be included in classes.The methods and events are derived to that class from interface then. The logic should be written inside methods of class.

In addition,

In Inheritance you can see single parent class can have multiple child classes but not vice versa.

So to have the facility of this kind of inheritance the concept of Interface arrives.

Read only

Former Member
0 Likes
739

Hi Wuyia,

Classes have Implementation whereas Interfaces do not. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.

i) Interfaces enable multiple inheritances to the object.

ii)Interfaces contain only the definitions for the members without implementation.

Regards,

Sai

Read only

Former Member
0 Likes
739

Hi Wuyia nata,

What is an Interface?

A Java keyword used to define a collection of method definitions and constant values. It can later be implemented by classes that define this interface with the "implements" keyword.

What is a class?

A class definition defines instance and class variables and methods, as well as specifying the interfaces the class implements and the immediate superclass of the class. If the superclass is not explicitly specified, the superclass will implicitly be Object.

For further information and the process of implementing you please refer these links. You will having some clear picture.

http://java.sun.com/docs/books/tutorial/java/concepts/class.html

http://java.sun.com/docs/books/tutorial/java/concepts/interface.html

http://java.sun.com/docs/books/tutorial/java/IandI/createinterface.html

http://www.geekinterview.com/question_details/22958

Cheers,

Swamy Kunche