• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

wat clarification on marker interface and it use

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wat clarification on marker interface? i knew that marker interface is the an interface it doesnot have any methods, if it doesnot have any methods wat is the use of implementing this methods? as per basic java fundamentals , an interface is nothing but it has all abstract methods where u implementing an interface we need derive the methods?but wat about the case in marker interfce


Ex: serilizable interface...
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A good example is java.io.Serializable.

The marker interface works like a boolean flag to indicate the class implementing this interface has some capability, but there is not method involved.
 
anilellendula kumar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if it doesnot have abstratct methods, how it has become interface, as per basic java , interface is nothing but it has abstract methods, where u implement an interface , we need to derive the all methods of the an interface, But in marker interface it is NOT happening , why it is called as an interface




 
Qi Liang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think whether abstract method is defined is not the key that one interface becomes interface. Any way, in practice, the marker interface is used widely.
 
reply
    Bookmark Topic Watch Topic
  • New Topic