Marker interfaces in java

Marker interfaces in java

how marker interfaces work?

View Answers

January 19, 2011 at 5:00 PM

Hi Friend,

In java language programming, interfaces with no methods are known as marker interfaces. Marker interfaces are Serializable, Clonable, SingleThreadModel, Event listener. Marker Interfaces are implemented by the classes or their super classes in order to add some functionality.

e.g. Suppose you want to persist (save) the state of an object then you have to implement the Serializable interface otherwise the compiler will throw an error. To make more clearly understand the concept of marker interface you should go through one more example.

Suppose the interface Clonable is neither implemented by a class named Myclass nor it's any super class, then a call to the method clone() on Myclass's object will give an error. This means, to add this functionality one should implement the Clonable interface. While the Clonable is an empty interface but it provides an important functionality.

Example:

interface markerImp {
}

class MarkerTest implements markerImp{
}

public class TestInstanceOf {
public static void main(String []args){
MarkerTest mt = new MarkerTest();
if(mt instanceof markerImp){
System.out.println("True");
}
else{
System.out.println("False");
}
}
}

For more information, visit the following link:

Marker Interface

Thanks


January 19, 2011 at 5:14 PM

By implementing Serializable interface which has no methods and variables, how the class know to save the state of the object?









Related Tutorials/Questions & Answers:
Marker interfaces in java
Marker interfaces in java  how marker interfaces work
Marker Interface,Java Marker Interface
; In this section we will learn about Interface and Marker Interfaces in Java...;stopcar (int Obj); } Marker Interface In java language programming, interfaces with no methods are known as marker interfaces
Advertisements
Marker Interface - Java Interview Questions
.  Hi friend, Marker interface : In java language programming, interfaces with no methods are known as marker interfaces. Marker interfaces are Serializable, Clonable, SingleThreadModel, Event listener. Marker Interfaces
Marker Interface In Java
Marker Interface In Java In this section we will read about marker interface in Java. This section will describe you the various aspects of marker interface.... Marker interface has no any members. It is an empty interface. In Java some built
tagged/marker interface in java - Java Beginners
. Interfaces with no methods are called marker interfaces and they are used to tag...tagged/marker interface in java  Hi! what is the exact meaning and usage of of tagged or marker interface. Exactly where we will use it in real
Interface in Java
; In this section we will learn about Interface and Marker Interfaces in Java... Interface In java language programming, interfaces with no methods are known as marker interfaces. Marker interfaces are Serializable, Clonable, SingleThreadModel
problem on marker interface - Java Beginners
problem on marker interface  i want to know about marker interface... tagged or marker interface is used to just identify the class, in real time... module,this tag or marker interface is useful. *. In serialization also
marker interface - Java Interview Questions
marker interface  how to create our owen marker interface ? can u give me one example  Hi Friend, Try the following code: interface... link: http://www.roseindia.net/java/master-java/interface.shtml Thanks
Marker Interface - Java Interview Questions
Marker Interface   Hi Friends, Marker interface means a method which has no methods. so what is d use of tat. I read "It is used to check that whether the instance belongs to that class". then wat is d use
Java interfaces
Java interfaces  What interface must an object implement before it can be written to a stream as an object
java interfaces
java interfaces  sample code for multiple interface   interface A { void test(int i); } interface B { void test(String s); } public class MultipleInterface implements A, B { public void test(int i
difference between marker and tag interface - Java Interview Questions
); } Marker Interface In java language programming, interfaces with no methods are known as marker interfaces. Marker interfaces are Serializable, Clonable, SingleThreadModel, Event listener. Marker Interfaces are implemented by the classes
java interfaces implementation
java interfaces implementation  hai I have defined one inter face like Maths taking methods like add(), sub(), mul()in interface I take different implementation classes for add() method and sub()and mul() when i trying
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces. eg: ---- interface i1
interfaces - Java Beginners
, super class constructor runs.what about interfaces?  Hi Friend... is called the base class or the parent class. To derive a class in java the keyword... to : http://www.roseindia.net/java/language/inheritance.shtml Thanks
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces in single class? my query
how to create interfaces in java
how to create interfaces in java  HI, Here is my code public interface validateInfo { public void validate(String empcode, String password); } class updateInfo implements validateInfo { public void update() { //code
Marker interface
Marker interface  what is a marker interface? what is its significance
interfaces
& interfaces.   An interface declaration introduces a new reference type whose members are classes, interfaces, constants and abstract methods... to directly implement one or more interfaces, meaning that any instance of the class
interfaces - Java Beginners
interfaces  examples on interfaces  Hi Friend, Please visit the following links: http://www.roseindia.net/java/master-java/interface.shtml http://www.roseindia.net/java/java-exception/create-interface.shtml
Marker Interface
Marker Interface  What is the need of Marker Interface?When should we use
Diff Bn Marker Interface and instanceOf - Java Interview Questions
Diff Bn Marker Interface and instanceOf   Hi Friends, Wats d difference bn Marker Interface and instanceOf method. Thanks
What are Classes and Interfaces in Java?
In this tutorial we are going to discuss about classes and interfaces in Java... and interfaces concepts in detail. What are classes? Java is Object oriented... are interfaces?ADS_TO_REPLACE_3 Interfaces in Java is also used to define the design
What is a Marker Interface?
What is a Marker Interface?   Hi, What is a Marker Interface? thanks
java
java  What is a Marker Interface?  In java language programming, interfaces with no methods are known as marker interfaces
ModuleNotFoundError: No module named 'marker'
ModuleNotFoundError: No module named 'marker'  Hi, My Python... 'marker' How to remove the ModuleNotFoundError: No module named 'marker'... to install padas library. You can install marker python with following command
Maven dependency for excalibur-instrument-manager-interfaces - excalibur-instrument-manager-interfaces version 1.0 is released. Learn to use excalibur-instrument-manager-interfaces version 1.0 in Maven based Java projects
-manager-interfaces version 1.0 ) in their Java project if it is based on Maven...-instrument-manager-interfaces version 1.0 java library in your project. Now...; - Version 1.0 of excalibur-instrument-manager-interfaces released The developers
What are the different types of interfaces in java? - Java Interview Questions
What are the different types of interfaces in java?  Hi, Is it correct question.I faced this in one interview. If yes can u tell me please. thanks chandu
ModuleNotFoundError: No module named 'trademac-marker'
ModuleNotFoundError: No module named 'trademac-marker'  Hi, My... named 'trademac-marker' How to remove the ModuleNotFoundError: No module named 'trademac-marker' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'magic-marker'
ModuleNotFoundError: No module named 'magic-marker'  Hi, My Python... 'magic-marker' How to remove the ModuleNotFoundError: No module named 'magic-marker' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'trademark-marker'
ModuleNotFoundError: No module named 'trademark-marker'  Hi, My... named 'trademark-marker' How to remove the ModuleNotFoundError: No module named 'trademark-marker' error? Thanks   Hi, In your
Interfaces in flex
Interfaces in flex  Hi..... Please tell me about... What are - IStyleClient, IChildList, ILayoutManager, IToolTipManagerClient, IInvalidating... defines a marker interface. Classes that support this interface declare support
Overview of Networking through JAVA,Getting list of Local Interfaces on a machine
Getting list of Local Interfaces on a machine... to find out the total no of list of local interfaces available on a machine. Here... the local interfaces which are instances of NetworkInterface class and displays
EJB Interfaces
EJB Interfaces       Interface in java means a group of related methods with empty bodies. EJB have generally 4 interfaces. These are as follows 1)Remote interface:- Remote interface
Maven dependency for altrmi - altrmi-client-interfaces version 0.9.6 is released. Learn to use altrmi-client-interfaces version 0.9.6 in Maven based Java projects
; altrmi - altrmi-client-interfaces version 0.9.6 in Java projects. Follow the step...-interfaces released The developers of   altrmi - altrmi-client-interfaces..., the released version of  altrmi - altrmi-client-interfaces library is 0.9.6.
Maven dependency for altrmi - altrmi-server-interfaces version 0.9.6 is released. Learn to use altrmi-server-interfaces version 0.9.6 in Maven based Java projects
; altrmi - altrmi-server-interfaces version 0.9.6 in Java projects. Follow the step...-interfaces released The developers of   altrmi - altrmi-server-interfaces..., the released version of  altrmi - altrmi-server-interfaces library is 0.9.6.
EJB Interfaces
EJB Interfaces       Interface in java means a group of related methods with empty bodies. EJB have generally 4 interfaces. These are as follows 1)Remote interface:- Remote interface
ModuleNotFoundError: No module named 'pytest-fixture-marker'
ModuleNotFoundError: No module named 'pytest-fixture-marker'  Hi...: No module named 'pytest-fixture-marker' How to remove the ModuleNotFoundError: No module named 'pytest-fixture-marker' error? Thanks   Hi
ModuleNotFoundError: No module named 'pytest-manual-marker'
ModuleNotFoundError: No module named 'pytest-manual-marker'  Hi...: No module named 'pytest-manual-marker' How to remove the ModuleNotFoundError: No module named 'pytest-manual-marker' error? Thanks   Hi
ModuleNotFoundError: No module named 'pytest-marker-bugzilla'
ModuleNotFoundError: No module named 'pytest-marker-bugzilla'  Hi...: No module named 'pytest-marker-bugzilla' How to remove the ModuleNotFoundError: No module named 'pytest-marker-bugzilla' error? Thanks   Hi
What are Callback interfaces?
What are Callback interfaces?  Hi, What are Callback interfaces? thanks
core java - Java Beginners
; Hi friend, Marker Interface : In java language programming, interfaces with no methods are known as marker interfaces. Marker interfaces are Serializable, Clonable, SingleThreadModel, Event listener. Marker Interfaces
ModuleNotFoundError: No module named 'interfaces'
ModuleNotFoundError: No module named 'interfaces'  Hi, My Python... 'interfaces' How to remove the ModuleNotFoundError: No module named 'interfaces' error? Thanks   Hi, In your python environment you
Hibernate Callback interfaces
Hibernate Callback interfaces  What are Callback interfaces?   Callback interfaces allow the application to receive a notification when something interesting happens to an object?for example, when an object is loaded
interfaces,exceptions,threads
interfaces,exceptions,threads  SIR,IAM JAVA BEGINER,I WANT KNOW THE COMPLETE CONEPTS OF INTERFACES,EXCEPTIONS,THREADS   Interface... class. In java, multiple inheritance is achieved by using the interface
ModuleNotFoundError: No module named 'odoo12-addon-fieldservice-google-marker-icon-picker'
ModuleNotFoundError: No module named 'odoo12-addon-fieldservice-google-marker...: ModuleNotFoundError: No module named 'odoo12-addon-fieldservice-google-marker...;odoo12-addon-fieldservice-google-marker-icon-picker' error? Thanks  
ModuleNotFoundError: No module named 'odoo12-addon-web-widget-google-marker-icon-picker'
ModuleNotFoundError: No module named 'odoo12-addon-web-widget-google-marker...: ModuleNotFoundError: No module named 'odoo12-addon-web-widget-google-marker-icon...;odoo12-addon-web-widget-google-marker-icon-picker' error? Thanks   
ModuleNotFoundError: No module named 'odoo8-addon-contract-recurring-invoicing-marker'
-marker'  Hi, My Python program is throwing following error...-marker' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-contract-recurring-invoicing-marker' error? Thanks   Hi
What are the Core interfaces are of Hibernate framework?
What are the Core interfaces are of Hibernate framework?  Hi, What are the Core interfaces are of Hibernate framework? Thanks
Collection Interfaces
Collection Interfaces     ... of several interfaces, and classes that implement those interfaces, contained within... of objects.  Different interfaces describe different types of functionalities

Ads