Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java

 
Abcd
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is Marker interface required?
 
Abcd
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abcd
Welcome to JavaRanch!

We're pleased to have you here with us in the Servlets forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
[ June 02, 2006: Message edited by: Ben Souther ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marker interfaces give us a way to specify and query an attribute of an object. For example, to see if an object would like to be serialized we can test whether it implements the Serializable interface.

Java 5 introduced annotations which provide a better way to specify such metadata attributes, so we shouldn't write new marker interfaces any more.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15438
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short, simple questions can often be answered in a few seconds by using an Internet search engine. Google for "java marker interface", for example, and you'll find lots of useful info:

The Purpose of the Marker Interface
Wikipedia: Marker interface pattern
etc.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The FAQ pages for this very forum have something to say about marker interfaces.

And please use a more descriptive topic subject next time - "Java" means nothing in a forum devoted exclusively to Java.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abcd just needs a last name. Maybe Snakes.

ABCD snakes?
LMNO snakes.
SMR snakes! CMEDBD eyes?
LIB! MR snakes!
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
Abcd just needs a last name. Maybe Snakes.

ABCD snakes?
LMNO snakes.
SMR snakes! CMEDBD eyes?
LIB! MR snakes!


LIB!

I stared at it, thought about it, scratched my head, thought some more, took a shot of Vodka, and drank two beers. Finally I got it. There's 20 minutes of my life I'll never get back. :roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic