Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Ticket {
- private int ticketNumber;
- double ticketPrice;
- // constructor for a new Ticket object
- public Ticket(int ticketNumber) {
- this.ticketNumber = ticketNumber;
- }
- public double getPrice() {
- return this.ticketPrice;
- }
- public String toString() {
- String ticket = "Number: " + ticketNumber + ", " + "Price: " + ticketPrice;
- return ticket;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement