Guest User

Untitled

a guest
Sep 26th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public class Product
  2. {
  3.  
  4.  
  5. private Stringname;
  6. private int quantity;
  7. private double price;
  8.  
  9. public Product(Stringname, int quantity, double price){
  10.  
  11. this.name = name;
  12. this.quantity = quantity;
  13. this.price = price;
  14.  
  15.  
  16. public void setName(Stringname)
  17. {
  18. this.name = name;
  19.  
  20. }
  21.  
  22. public String getName()
  23. {
  24. return name;
  25. }
  26.  
  27. public void setQuantity(int quantity)
  28. {
  29. this.quantity = quantity;
  30.  
  31. }
  32.  
  33. public String getQuantity()
  34. {
  35. return quantity;
  36. }
  37.  
  38. public void setPrice(double price)
  39. {
  40. this.price = price;
  41.  
  42. }
  43.  
  44. public String getPrice()
  45. {
  46. return price;
  47. }
  48.  
  49. }
  50.  
  51. }
Add Comment
Please, Sign In to add comment