jam/FatCat

From ggc

Jump to: navigation, search

01 package jam;
02 
03 import wiki.Wiki;
04 /**
05  * All about my class here.
06  @author Jam Jenkins
07  */
08 public class FatCat implements Comparable<FatCat>
09 {
10   private String name;
11   private int weight;
12 
13   public FatCat(String name, int weight)
14   {
15     this.name=name;
16     this.weight=weight;
17   }
18 
19   public String toString()
20   {
21     return name+" weighing "+weight+" lbs";
22   }
23 
24   public int compareTo(FatCat cat)
25   {
26     return this.weight-cat.weight;
27   }
28 }


Download/View jam/FatCat.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter