Advertisement
chrisenoch

Product.java

Oct 3rd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package murach.business;
  2. import java.io.Serializable;
  3. import java.text.NumberFormat;
  4. class Product implements Serializable {
  5.  
  6. private String code;
  7. private String description;
  8. private double price;
  9.  
  10. public Product() {
  11. code = "";
  12. description = "";
  13. price = 0;
  14. }
  15. public void setCode(String code) {
  16. this.code = code;
  17. }
  18. public String getCode() {
  19. return code;
  20. }
  21. public void setDescription(String description) {
  22. this.description = description;
  23. }
  24. public String getDescription() {
  25. return description;
  26. }
  27. public void setPrice(double price) {
  28. this.price = price;
  29. }
  30. public double getPrice() {
  31. return price;
  32. }
  33. public String getPriceCurrencyFormat() {
  34. NumberFormat currency = NumberFormat.getCurrencyInstance();
  35. return currency.format(price);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement