Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding marker interfaces  RSS feed

 
Manoj Kumar Ravikanti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

My question is why didn't they devolop keywords instead of marker interfaces because marker interfaces doesn't contain any methods. it tells the jvm to perform somethings that are relevent to the interface so do the keywords

Thankyou
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking back, most people have decided that marker interfaces aren't an especially good idea, and so they're little used in new code. Java 5 introduced annotations which are, in effect, a way to introduce new keywords to be used the way marker interfaces were.

But to answer your question: adding a new keyword to a language is a drastic step that always breaks some existing code that just happens to have used that keyword as a variable name. It also complicates the language grammar and therefore the compiler and the language reference manual. In general, Java's designers wanted to avoid these issues.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!