This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
can somebody xplain how to use the externalizable interface to write my own serialization. i would appreciate an example that demonstrates writing and reading of an object which implements the Externalizable interface. thanx in advance...
"Component Development for the Java Platform" by Stuart Dabbs Halloway (chapter4) has an excellent treatment on serialization (in particular, there are good explanations of potential problems with externalizable You can download the book here.
I haven't really looked at your code or tried to figure out the problem, but one potential source of confusion/bugs is your exception handling strategy in the writeExternal and readExternal methods. If an exception were thrown during the execution of either method, nobody would ever know about it - they just bury the exception and return. I'd at least print a message to the error output stream, System.err .
thanx dirk. it helped. so it actually is cos whatever class is trying to create the object of my test class is in the default jdk package! But any ideas as to how the instantiation is actually done. i.e. which class handles it. thanx