KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > f1 > chapter21 > Car


1 package com.db4o.f1.chapter21;
2
3 import com.db4o.f1.chapter21.Pilot;
4
5 public class Car {
6     private String JavaDoc model;
7     private Pilot pilot;
8     
9     public Car(String JavaDoc model) {
10         this.model=model;
11         this.pilot=null;
12     }
13       
14     public Pilot getPilot() {
15         return pilot;
16     }
17     
18     public void setPilot(Pilot pilot) {
19         this.pilot = pilot;
20     }
21     
22     public String JavaDoc getModel() {
23         return model;
24     }
25     
26     public String JavaDoc toString() {
27         return model+"["+pilot+"]";
28     }
29 }
30
Popular Tags