Wednesday, September 24, 2008

How to define an Interface in Java ? - JAVA Interview Questions and Answers

How to define an Interface in Java ?
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 functionOne();

public long CONSTANT_ONE = 1000;
}

No comments:

Post a Comment

Thanks to given comments.......

My Blog List