• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding marker interfaces

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic