Thursday, January 6, 2011

What is Interface ?

An interface is a group of related methods with empty bodies.
Example :
Interface interfaceDemo
{
public void msgPrint();
}

Some facts about interface:
o   Interface methods are by default public abstract.
o   Interface variables are by default public static final.
o   We can’t declare interface method private.
o   We can’t make object of an interface.
o   We can’t extend an interface in class but we can implements it.
o   We can do multiple inheritance through interface.

No comments:

Post a Comment

Spring Boot Config Server and Config Client.

 In Spring cloud config we can externalise our configuration files to some repository like GIT HUT, Amazon S3 etc. Benefit of externalising ...