answersLogoWhite

0

An Interface is nothing but a contract as to how a class should behave. It just declares the behavior as empty methods and the implementing class actually writes the code that will determine the behavior.

When you implement an interface, you're agreeing to adhere to the contract defined in the interface. That means you're agreeing to provide legal implementations for every method defined in the interface, and that anyone who knows what the interface methods look like can rest assured that they can invoke those methods on an instance of your implementing class. (Thy need not bother much about how you have implemented it. All they bother about is whether a method of the name mentioned in the interface is available or not)

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Can you do java keylogger?

Yes, it is possible to write a keylogger in Java, but you would need to use the Java Native Interface to do so.


What is JNI?

Java Native Interface JNI is an interface between java and applications and libraries written in other languages. As an example, JNI enables Java programs to use C libraries and also enables C programs to use Java classes.


Is interface class a valid term?

Yes. An interface in essence is a java class and so you can use the term interface class. But, using the term class along with the term interface can cause ambiguity or misunderstandings among novice java developers. So, using the term "Interface" along would suffice to refer to a type of class which is the "Interface"


What would interface java be used for?

Interface Java can be used for a variety of tasks and commands such as .swf files, Java files, running scripts, as well as website video players for websites.


Can you define variables in interface in java?

yes we can define a variable in an interface in java.


Can you create a constructor for an interface in java?

NO, we cannot create a contructor for an interface in java.


What is intrface in java?

interface is a list of methods which implements that interface


How do you use Java Native Interface to access Delphi code from Java classes?

The Delphi code would need to be compiled into a DLL, and the DLL is then called from java using the JNI. See http://home.pacifier.com/~mmead/jni/delphi/JavaToDPR/ to get started.


What is a tagging interface type?

A tagging interface type in Java is an interface that has not defined methods such as the java.io.Serializable interface.


In the field of computers what does the term java interface mean?

In Java, an interface is a suite of methods that multiple different classes are able to implement. Interfaces are not assigned to any particular class. For example, multiple graphics classes can use the same interface to change their size and colour.


What java interface must be implemented by all threads?

Runnable interface


Can you create an empty interface with no definitions?

Yes. This is a valid interface definition in Java: interface Useless {}