wood burning stoves
The moose likes I/O and Streams and the fly likes serialization for class Object references Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "serialization for class Object references" Watch "serialization for class Object references" New topic

serialization for class Object references

kumarth ravi
Ranch Hand

Joined: Jun 01, 2007
Posts: 48
The classes which are declared in serialized class must be serialized?


A class can be serialized with out giving error?

with regards
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24193

Why not try it and see?

[Jess in Action][AskingGoodQuestions]
kumarth ravi
Ranch Hand

Joined: Jun 01, 2007
Posts: 48
I have written a simple program,but it has thrown exception.

Exception in thread "main" java.io.NotSerializableException: B
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at SerialTest.main(SerialTest.java:27)
I agree. Here's the link: http://aspose.com/file-tools
subject: serialization for class Object references
jQuery in Action, 3rd edition