Question :If class A does not implement Serializable but a subclass B implements
Serializable, will the fields of class A be serialized when B is
serialized? (CoreJava)
Answer :Only the fields of Serializable objects are written out and restored. The
object may be restored only if it has a no-arg constructor that will initialize
the fields of non-serializable supertypes. If the subclass has access to the
state of the superclass it can implement writeObject and readObject to
save and restore that state.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
If class A does not implement Serializable but a subclass B implements
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment