KickJava   Java API By Example, From Geeks To Geeks.

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


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