answersLogoWhite

0

What is markable interface in java?

Updated: 10/2/2023
User Avatar

Wiki User

14y ago

Best Answer

The Interface which doesn't have any declarations of methods are called the markable interface (or marker interface)

They are named marker interfaces, because their only purpose is to mark special classes.

Example:

In the Java API there is the interface Cloneable. Since Object already has the method clone() the Cloneable Interface is empty and is only used to mark classes, which objects are allowed to clone.

There are Three marker interfaces that are Serializable,Remote and Cloneable.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is markable interface in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you create a constructor for an interface in java?

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


Can you define variables in interface in java?

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


What is intrface in java?

interface is a list of methods which implements that interface


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.


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 {}


What do mean by interface in java?

An interface in Java is like an abstract class, but there are no method bodies allowed in it and it has to be declared with the interface keyword. It is Java's way of getting around the Deadly Diamond of Death. Only abstract methods and constants are allowed in it.


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.


What is interface in java?

Interface is collection of abstract methods which has only declaration and no implementation


Can you create an object of interface in java?

maybe


Can you instantiate an interface?

According to a beginner's book on Java, an interface can't have constructors. Also, the interface itself can't contain the method implementation.


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.