The Loan class given in the text does not implement java.io.Serializable. Analyze the following code.
```
public class Foo implements java.io.Serializable {
private int v1;
private static double v2;
private Loan v3 = new Loan();
}
```
a. An instance of Foo can be serialized because Foo implements Serializable.
b. An instance of Foo cannot be serialized because Foo contains a non-serializable instance variable v3.
c. If you mark v3 as transient, an instance of Foo is serializable.
Key:bc An object may not be serialized even though its class implements java.io.Serializable, because it may contain non-serializable instance variables.
b. An instance of Foo cannot be serialized because Foo contains a non-serializable instance variable v3.
c. If you mark v3 as transient, an instance of Foo is serializable.
An object may not be serialized even though its class implements java.io.Serializable, because it may contain non-serializable instance variables.
You might also like to view...
A double-ended queue allows
a) adding elements at one end and removing them from both ends b) adding elements at both ends and removing them from one end c) adding elements at one end, removing them from the other end, and viewing (first) elements at either end. d) adding, removing, and viewing elements at either end. e) none of the above
You can combine modes using the _________ operator.
a. || b. && c. + d. & e. |
The item marked 3 in the accompanying figure is used for ____.
A. static objects B. animations within a movie C. dynamic objects D. interactivity
____________________ objectives answer the question, "What should the trainees be able to do as a result of this training session?"
Fill in the blank(s) with the appropriate word(s).