
A.restore400
B.restore403
C.restore453
D.Compilationfails.
E.Anexceptionisthrownatruntime.
第1题:
AssumingthattheserializeBanana2()andthedeserializeBanana2()methodswillcorrectlyuseJavaserializationandgiven:
importjava.io.*;
classFood{Food(){System.out.print(”1”);}}
classFruitextendsFoodimplementsSerializable{
Fruit(){System.out.print(”2”);}}
publicclassBanana2extendsFruit{intsize=42;
publicstaticvoidmain(String[]args){
Banana2b=newBanana2();
b.serializeBanana2(b);//assumecorrectserialization
b=b.deserializeBanana2(b);//assumecorrect
System.out.println(”restored+b.size+);}
//moreBanana2methods
}
Whatistheresult?()
第2题:

A.Compilation fails.
B.exception is thrown at runtime.
C.The attribute id in the ItemTest object remains unchanged.
D.The attribute id in the ItemTest object is modified to the new value.
E.A new ItemTest object is created with the preferred value in the id attribute.
第3题:

A.Tea
B.Coffee
C.CoffeeTea
D.Compilationfails
第4题:
A. Foohasthevalue“”
B.Foohasthevaluenull
C.Anexceptionisthrown
D.Thecodewillnotcompile
第5题:

A.ad
B.ada
C.add
D.adad