File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 13881
    
  10

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Serializable and Thread
 
Similar Threads
Serializable Super class,Non-Serializabl Sub Class
My serialization class - warning
Why not its ClassCastException?
private(?) writeObject/readObject
K &B: "Serialization Is Not for Statics"