0% found this document useful (0 votes)
16 views2 pages

Understanding Interfaces and Abstract Methods

The document discusses interfaces, abstract methods, and how they are implemented in classes. Interfaces contain only public abstract methods and no implementation, while abstract classes can contain implemented methods in addition to abstract ones. Classes can implement multiple interfaces and abstract classes, allowing the same method name to exist in different interfaces and classes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Understanding Interfaces and Abstract Methods

The document discusses interfaces, abstract methods, and how they are implemented in classes. Interfaces contain only public abstract methods and no implementation, while abstract classes can contain implemented methods in addition to abstract ones. Classes can implement multiple interfaces and abstract classes, allowing the same method name to exist in different interfaces and classes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Today's Class:

______________________________________________________________
Interfaces
INterface Methods = Abstract Methods
How Interface related Abstract Methods will participate in RUNTIME
Artifacts( Extension Class)
HOW ABstract class related Abstract methods will participate in RUNTIME
artifacts( Extension Class)
Conclusion :
____________________________________________________

Interface:
-------------------------
Interface contains ALL ABstract Methods
---
Interface contains ALL Abstract Methods in "PUBLIC section ONLY"
--------------------

Interface Contains only DEFINITION part But NO(ZERO) IMPLEMENTATION

For An Interface , we cannot create an OBJECT, BCoz Interface doesnot contain


implementation.
But
For An Interface , we can define "REFERENCE"

ABstract methods of Interface is also known "INTERFACE methods"


------------------------------ ------------------

_______________________________________________________________
Advantage of Interfaces:
_______________________

Methods of an Interface can have different implementations in Different CLASSes


-------

Multiple Interfaces can be Implemented inside SINGLE CLASS.

_______________________________________________________________
NOTE :

between CLASS to CLASs -----> we apply


Inheritance
redefine
Implement methods
_____________________________________________________________
NOTE :

between Interface to CLASS---> we apply


Implement Methods
_____________________________________________________________

NOTE : IN our odata NW ABAP gateway services

_DPC_EXT ( Data Provider Extension CLASS )

___________________________________________________________________________________
___________
Gateway service DPC ( EXtension CLASS) will Implement Methods of MULTIPLE
INTERFACEs
+
will IMPLEMENT methods of ONE ABstract CLASS
___________________________________________________________________________________
___________

Interface methods will participate in A CLASS


using INTERFACENAME~METHODNAME
-------------------------

Abstract Class methods will participate in A CLASS


using METHODNAME
------------
_________________________________________________________

same Method name can exists in Multiple INTERFACES.

EVEN then EXTENSION CLASS can implement same method of Multiple Interfaces.
__________________________________________________________

same Method name can exists in multiple Interfaces + one ABSTRACT CLASS

EVEN THEN EXTENSION CLASS Can implement same method of multiple interfaces + one
ABstract class
___________________________________________________________________________________
_______________

You might also like