Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

gameclassitems2

By: ace on Jul 21st, 2010  |  syntax: None  |  size: 0.96 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. /**
  3.  * Write a description of class Item here.
  4.  *
  5.  * @author (your name)
  6.  * @version (a version number or a date)
  7.  */
  8. public class Item
  9. {
  10.     // instance variables - replace the example below with your own
  11.     private int itemWeight;
  12.     private String itemDescription;
  13.     /**
  14.      * Constructor for objects of class Item
  15.      */
  16.     public Item(int itemWeight, String itemDescription)
  17.     {
  18.         // initialise instance variables
  19.        this.itemWeight = itemWeight;
  20.        this.itemDescription = itemDescription;
  21.      
  22.     }
  23.  
  24.     /**
  25.      * An example of a method - replace this comment with your own
  26.      *
  27.      * @param  y   a sample parameter for a method
  28.      * @return     the sum of x and y
  29.      */
  30.     public String getItemDescription(Item item)
  31.     {
  32.         return itemDescription;
  33.        
  34.     }
  35.    
  36.     public int getItemWeight(Item item)
  37.         {
  38.             return itemWeight;
  39.         }
  40.        
  41.        
  42.        
  43. }