Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Prize {
- //Instance variables.
- private int price;
- private String name;
- //Constructor.
- public Prize()
- {
- this.name = "none";
- this.price = 0;
- }
- //Parameterized Constructor.
- public Prize(String aName, int aPrice)
- {
- this.setName(aName);
- this.setPrice(aPrice);
- }
- //Getters and Setters yeehaw
- public int getPrice() {
- return price;
- }
- public void setPrice(int price) {
- this.price = price;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement