KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > houseexample > Man


1 package houseexample;
2
3 /**
4  * @author delpiano
5  *
6  * To change this generated comment edit the template variable "typecomment":
7  * Window>Preferences>Java>Templates.
8  * To enable and disable the creation of type comments go to
9  * Window>Preferences>Java>Code Generation.
10  */

11 public class Man {
12     
13     private String JavaDoc name;
14     private House where_he_is;
15     
16     public Man(String JavaDoc name) {
17         super();
18         this.name = name;
19         where_he_is = null;
20     }
21     
22     public void imHome(House house) {
23         house.writeOnBoard("It's me " + name + ", I'm home !");
24         where_he_is = house;
25     }
26     
27     public void imLeaving(House house) {
28         house.writeOnBoard("Bye folks, " + name + " is leaving !");
29         where_he_is = null;
30     }
31     
32     public House whereILive(){ return where_he_is; }
33
34 }
35
Popular Tags