• Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread Not Serialisable!Why?  RSS feed

 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I have a doubt regarding serialisation.Why the thread class ,Socket class,and OutputStream classes cannot be serialised?

Thanks...
 
Ivan Franko
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

first of all, because this classes not implemented interface Serializable.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instances of Classes such as Thread, Socket, etc are very very closely tied to the underlying operating system.

Knowing that it should be obvious why an instance can not be Serialized.

Bill
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Instances of Classes such as Thread, Socket, etc are very very closely tied to the underlying operating system.

I would go a step further and say that those objects are closely tied to particular processes (and wouldn't make sense outside of those).
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!