Skip to main content
Source Link
user12086548
user12086548

An interface in java is a special type of Abstract class, the Interface provided the 100% Abstraction but since the java introduce new features in java 8 the meaning of whole Interface is change. Interfaces are used to tell what should be done. But due to new features now we give implementations of methods in Interface, that changed the meaning of Interface. In Interface the method is public abstract by default

interface Bird{
        void sound();
         void eat();
        }

Java doesn't provide the multiple inheritances feature mean a class doesn't have two parents, but we extend multiple Interfaces in java.

Post Made Community Wiki by user12086548