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

item class 1

By: ace on Jul 21st, 2010  |  syntax: None  |  size: 0.87 KB  |  hits: 22  |  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.     private boolean itemExists;
  14.     /**
  15.      * Constructor for objects of class Item
  16.      */
  17.     public Item(int itemWeight, String itemDescription)
  18.     {
  19.         // initialise instance variables
  20.        this.itemWeight = itemWeight;
  21.        this.itemDescription = itemDescription;
  22.        itemExists = true;
  23.     }
  24.  
  25.     /**
  26.      * An example of a method - replace this comment with your own
  27.      *
  28.      * @param  y   a sample parameter for a method
  29.      * @return     the sum of x and y
  30.      */
  31.     public String giveItemDescription()
  32.     {
  33.         return itemDescription;
  34.        
  35.     }
  36. }