Meaningless Drivel is fun!
The moose likes Java in General and the fly likes Marker Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Marker Interface" Watch "Marker Interface" New topic

Marker Interface

Aby Ouseph

Joined: Dec 01, 2006
Posts: 10
What is marker interface?What is the use of this type of interfaces?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

A marker interface is one that has no methods defined, such as

These types of interfaces usually imply some type of a commitment on the part of the developer. Loosely stated, with Serializable, a commitment is made by the developer to use only the basic, standard, primitive data-types, or objects made up of them, and when using something that falls beyond that boundary, to mark it as being transient.

I hope I didn't just do your homework.

-Cameron McKenzie
Kai Witte
Ranch Hand

Joined: Jul 17, 2004
Posts: 356
Originally posted by Aby Ouseph:
What is the use of this type of interfaces?

I do not believe that they have any legitimate use.

See also "less fundamental implications" in my Design Principles.


Kai Witte's business website Kai Witte's private homepage
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

That question gets asked so frequently that it has an entry in the JavaIntermediateFaq. You'll find the older discussions by searching through the forums.
I agree. Here's the link:
subject: Marker Interface
It's not a secret anymore!