File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes WhizLab question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "WhizLab question" Watch "WhizLab question" New topic
Author

WhizLab question

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi,


The _____ interface allows the class to have complete
control over its serialization


Fill in the blanks...


Thanks,
cmbhatt


(look no bang !)
[ April 26, 2007: Message edited by: Barry Gaunt ]

cmbhatt
megha joshi
Ranch Hand

Joined: Feb 20, 2007
Posts: 206
From the Java API...


public interface Externalizable
extends Serializable
Only the identity of the class of an Externalizable instance is written in the serialization stream and it is the responsibility of the class to save and restore the contents of its instances. The writeExternal and readExternal methods of the Externalizable interface are implemented by a class to give the class complete control over the format and contents of the stream for an object and its supertypes. These methods must explicitly coordinate with the supertype to save its state. These methods supercede customized implementations of writeObject and readObject methods.
Object Serialization uses the Serializable and Externalizable interfaces. Object persistence mechanisms can use them as well. Each object to be stored is tested for the Externalizable interface. If the object supports Externalizable, the writeExternal method is called. If the object does not support Externalizable and does implement Serializable, the object is saved using ObjectOutputStream.
When an Externalizable object is reconstructed, an instance is created using the public no-arg constructor, then the readExternal method called. Serializable objects are restored by reading them from an ObjectInputStream.
An Externalizable instance can designate a substitution object via the writeReplace and readResolve methods documented in the Serializable interface.




Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Thanks for posting API note for Externalizable!

Externalizable is quite strong than the Serializable interface. However I have not used it yet!



Thanks,
cmbhatt
Rob Mech
Ranch Hand

Joined: Apr 05, 2007
Posts: 56
You know, whizlabs just got me on an Externalization question too. I didnt see anything in the K&B Book on it. (checked index and section in book)

Is this in fact on the test?

If so, I wonder what else is missing from the K&B Book.


Rob Mech, SCJP 1.5<br /><a href="http://www.robsprogrammingjunk.com/" target="_blank" rel="nofollow">http://www.robsprogrammingjunk.com/</a>
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
No Rob,

I should have not posted this question on this forum, because sometimes it causes confusion. Like you some others might have gone through index and contents of the book as well exam objective list. Actually Externalization is not on the Exam. But what to say of simulators. It is hard to be 100% specific.

Anyways Serialization is on the exam list; Externalization is subclass of Serialization.


cmbhatt
Rob Mech
Ranch Hand

Joined: Apr 05, 2007
Posts: 56
I was ok with the post I was just curious. According to whizlabs support they say that Serialization is on there and that Externalizable is part of it but frankly I dont believe it.

Hey, doesnt hurt to learn it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WhizLab question
 
Similar Threads
NX: Reading from the DB
TOMCAT Environmental Variables
Weird error
SCJP 1.5 review - not a so good test?
design the Java swing with dynamic creation of JTextfield,JLabel,Jcombobox