Java - Interface Partial Implementing

Introduction

A class does not have to provide implementations for all methods.

A class can provide partial implementations of the implemented interfaces.

If a class does not provide the full implementation of interfaces, it must be declared abstract.

Suppose we have the following interface

interface IABC {
        void m1();
        void m2();
        void m3();
}

ABCImpl has to be abstract since it does not implement all methods from IABC.

abstract class ABCImpl implements IABC {
        public void m1() {
                // Code for the method goes here
        }
}

We can further implement the methods from interface in subclass.

class DEFImpl extends ABCImpl {
        // Other code goes here

        public void m2() {
                // Code for the method goes here
        }

        public void m3() {
                // Code for the method goes here
        }
}