• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why are Iterators non-serializable?  RSS feed

 
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: 42972
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!