top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the interface and how to define it in Java ?

+5 votes
236 views
What is the interface and how to define it in Java ?
posted Nov 20, 2013 by Abhay Kulkarni

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.

Emaple of Interface:

public interface sampleInterface {
public void myfunction();

public long CONSTANT_ONE = 1000; 
}
answer Nov 21, 2013 by Luv Kumar
...