Name: rlT66838 Date: 09/09/97
1) Serialize an instance of DecimalFormat.
2) DeSerialize the serialized instance.
3) Call format on the deserialized instance.
You will get the following exception because
DecimalFormat.digitList is null:
java.lang.NullPointerException
at java.text.DecimalFormat.format(DecimalFormat.java:302)
at java.text.NumberFormat.format(NumberFormat.java:182)
DecimalFormat declares digitList to be
transient and initializes it to new DigitList().
The initialization is not executed
when deserializing so it is necessary to
implement a readObject method which does the
following:
private void readObject(ObjectInputStream in) throws IOException,
{
in.defaultReadObject();
digitList = new DigitList();
}
company - Neuron Data , email - ###@###.###
======================================================================