This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Serializable and Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Serializable and Thread" Watch "Serializable and Thread" New topic
Author

Serializable and Thread

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
I read following stuff on Sun's Website.




[ September 02, 2005: Message edited by: Chetan Parekh ]

My blood is tested +ve for Java.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Ofcourse you can, if you make a class that extends Thread and implements Serializable, you can serialize objects of that class. The article you refer to doesn't say it's impossible to serialize an object that extends Thread.

But it doesn't make much sense to serialize a thread-like object. Serialization makes sense for classes that are containers of data, not for "live" objects like threads, sockets etc.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
jQuery in Action, 2nd edition
 
subject: Serializable and Thread
 
Similar Threads
K &B: "Serialization Is Not for Statics"
Why not its ClassCastException?
Serializable Super class,Non-Serializabl Sub Class
My serialization class - warning
private(?) writeObject/readObject