• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is Runnable a marker interface ?  RSS feed

 
Sathiesh Kumar Vs
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

I have always had a thought like any interface that does not have any methods to be implemented, but just to show the JVM that its different from others would be called as a marker interface.

Sometime back a friend said that even Runnable is a marker interface, because though it has methods to be implemented, the execution of these threads should be different from usual JVM maintained internal threads.

So, can runnable called a marker interface ?
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No the Runnable interface is not a marker interface because it has methods. Marker interfaces don't have methods and can be used to identify desired functionality. In my opinion marker interface should not be used any more because annotations can fulfil the same functionality and are much more flexible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!