• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Marker Interface

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends ,
I am back here with my queries to be resolved by you.
Well i dont understand what is the significance of marker interface when there are no methos declaration in that ?
Could anyone highlight me the importance of marker interfaces ??
I hope you would resolve my query.This was one of the questions in the interview ..
Thanks,
Saurabh
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is one of the very good questions asked. Marker interface does not have any methods. This is true. the basic thing is that when we implement a marker interface the java compiler notes that it has implemented a certain interface and it will try to assign some properties to the class that implemented it. Like if SingleThreadModel interface is implemented then there may be some variables which will get attached to the class and whenever the objects of these classes are accessed the variables which exist in the marker interface may come into picture. these will help in keeping the object accessed by the users one at a time as SingleThread model does. kindly correct if I am wrong.
regards,
shekar.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marker interface is used by JVM to check instance. We can also create marker interface. Most of the time in interview it is asked.

For example : Serializable This is an interface which is compulsion to implement for serialization and it is checked during file read right.

For more details you can refer:
www.classiccoder.com
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Madhu, welcome to JavaRanch.

Please note that you are responding to a topic from 2004 - more than six years ago! The original poster is most likely not still waiting for an answer.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

madhu sahu wrote:... For more details you can refer: www.classiccoder.com


So you ask a question elsewhere, then you answer it yourself, and now you link to it from here? What is that all about (ignoring the annoying color of your post for the moment)?
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:

madhu sahu wrote:... For more details you can refer: www.classiccoder.com


So you ask a question elsewhere, then you answer it yourself, and now you link to it from here? What is that all about (ignoring the annoying color of your post for the moment)?



Maybe he is the owner of the classiccoder site! =P
 
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hebert Coelho wrote:Maybe he is the owner of the classiccoder site! =P



No joke... he's apparently the only one who ever posts there.
reply
    Bookmark Topic Watch Topic
  • New Topic