Implements

From Abap2Java

Jump to: navigation, search

ABAP

see INTERFACES

Jaba

The keyword implements indicates that a class provides implementations of the methods that are definded by interface(s) listed. A class can implement as many interfaces as needed, whereas it can only extend from one class.

interface java.lang.Comparable {
   int compareTo(Object o);
}
class Client implements Comparable, Cloneable {
   ...
   int compareTo(Obect o) {
      Client c = (Client) o;
      // do individual comparasion
      return r; // r = {-1,0,1}
   }
}

If one by the interface(s) defined methods is not implemented the class must be declared as abstract class.

See also
interface, class, abstract class, extends

Personal tools