Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public class Item {
  2.  
  3. private String description;
  4. private int weight;
  5.  
  6.  
  7. public Item(String description){
  8. this.description = description;
  9. }
  10.  
  11. public Item(String description, int weight){
  12. this.description = description;
  13. this.weight = weight;
  14. }
  15.  
  16. public String getDescription() {
  17. return description;
  18. }
  19.  
  20.  
  21. public int getWeight() {
  22. return weight;
  23. }
  24.  
  25.  
  26. public void setDescription(String description) {
  27. this.description = description;
  28. }
  29.  
  30.  
  31. public void setWeight(int weight) {
  32. this.weight = weight;
  33. }
  34.  
  35. public String toString(){
  36. return description;
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement