KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > animals > Wolf


1 package animals;
2
3 public class Wolf {
4
5     public int color;
6
7     public String JavaDoc name;
8
9     public Wolf() {
10     }
11
12     public Wolf(String JavaDoc _name, int _color) {
13         name = _name;
14         color = _color;
15         System.out.println("Creation of the " + getClass().getName() + " " + name);
16     }
17
18     protected void eat(String JavaDoc catName) {
19         System.out.println("The wolf " + name + " eats the cat " + catName);
20     }
21
22 }
23
Popular Tags