Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

null interfaces

 
feroz muhamed
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
please help me to answer this question. which is from an interview .Why there are some null interfaces in Java? What
does it mean? Give some null interface in Java?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never heard the term "null interface" but I'm betting the interviewer meant "empty" or "tagging" interfaces, like java.io.Serializable or java.lang.Cloneable. Both of these interfaces declare no methods; by implementing them, a class signals some fact to the JVM (either it's OK to serialize it, or it's ok to clone it.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic