Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why are Iterators non-serializable?

 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am not sure why Iterators in Collections framework are non-serializable? Is it wrong design to have my own iterator which extends serializable interface?

TIA
Satya Deep
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would it mean to have the Iterator serializable, since you can't force the underlying collection to be serialized at the same time?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic