• Post Reply Bookmark Topic Watch Topic
  • New Topic

Marker Interfaces  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marker Interfaces(Serializable, Clonable) should not have any methods. But we can use clone() for Clonable and readObject()/writeObject() for Serializable. Is it contract violation ?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't call it that, but it's certainly bad API design.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please look at this thread about the same subject. About Cloneable, find the appropriate chapter in Joshua Bloch's Effective Java.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!