Marker interface

Marker interface


 if an interface doesn’t contain any methods and by implementing that
interface if our object gets some ability such type of interfaces are called Marker interface (or)
Tag interface (or) Ability interface.

Example:
Serilizable
cloneable
RandomAccess These are marked for some ability
SingleThreadModel

Example 1: By implementing Serializable interface we can send that object across the network
and we can save state of an object into a file.
Example 2: By implementing SingleThreadModel interface Servlet can process only one client
request at a time so that we can get “Thread Safety”.
Example 3: By implementing Cloneable interface our object is in a position to provide exactly
duplicate cloned object.


SHARE

About df

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment