Advertisement
ShadowZek

Untitled

Jan 31st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public class Prize {
  2. //Instance variables.
  3. private int price;
  4. private String name;
  5. //Constructor.
  6. public Prize()
  7. {
  8. this.name = "none";
  9. this.price = 0;
  10. }
  11. //Parameterized Constructor.
  12. public Prize(String aName, int aPrice)
  13. {
  14. this.setName(aName);
  15. this.setPrice(aPrice);
  16. }
  17. //Getters and Setters yeehaw
  18. public int getPrice() {
  19. return price;
  20. }
  21. public void setPrice(int price) {
  22. this.price = price;
  23. }
  24. public String getName() {
  25. return name;
  26. }
  27. public void setName(String name) {
  28. this.name = name;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement