• Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Marker Interface  RSS feed

 
Kousik Majumder
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me how can we use custom Marker Interface?
Where should I declare that which method to implement if somebody use my custom marker interface?

Thanks n Advance

Kousik
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marker interfaces do not have methods, so there's nothing to implement. The way to use them by way of the instanceof operator, like
 
Kousik Majumder
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes..that is fine.....
Then how the the marker interfaces like Cloneable etc.. let understand JVM that clone() method has to implement ?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this topic for some discussion of Cloneable and Serializable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!