01: package example;
02:
03: public class Car implements java.io.Serializable {
04: private Model model;
05: private Color color;
06: private int year;
07:
08: public Car() {
09: }
10:
11: public Car(Model model, Color color, int year) {
12: this .model = model;
13: this .color = color;
14: this .year = year;
15: }
16:
17: public Model getModel() {
18: return this .model;
19: }
20:
21: public Color getColor() {
22: return this .color;
23: }
24:
25: public int getYear() {
26: return this .year;
27: }
28:
29: public String toString() {
30: return "Car[" + this .year + ", " + this .color + ", "
31: + this .model + "]";
32: }
33: }
|