top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

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

+5 votes
53 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 Google+ Share Button LinkedIn Share Button Multiple Social 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...