/* related posts with thumb nails */

What is an Interface:

An interface is a list of methods that must be defined by any class which implements that interface. It may also define constants (public static final). Interfaces are declared using the interface keyword, and may only contain method signatures and constant declarations. An interface may never contain method definitions.

·         The class which implements an interface must implement all of the methods described in the interface, or be an abstract class.
·         As interfaces are implicitly abstract, they cannot be directly instantiated except when instantiated by a class which implements the said interface.
·         In an interface, all methods are implicitly public.
·         In an interface, all variables are static and final by default
·         A class can implement many different interfaces.
·         One interface can extend another interface.
·         A class can simultaneously extend a class and implement multiple interfaces
·         One benefit of using interfaces is that they simulate multiple inheritances.
Related Topics:


Post a Comment