ace

item class 1

ace
Jul 21st, 2010
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment