Java - object interaction
How would I be able to say create many ticket machines, each with many tickets that can be chosen?
I've created the classes "TicketMachine" and "Ticket". I want the ticketmachine to be able to work out if the customers puts enough money in for a ticket but to do that they need to be able to select what ticket they want, and then the ticketmachine needs to get the tickets price from the ticket object.
How would I be able to say create many ticket machines, each with many tickets that can be chosen?
I've created the classes "TicketMachine" and "Ticket". I want the ticketmachine to be able to work out if the customers puts enough money in for a ticket but to do that they need to be able to select what ticket they want, and then the ticketmachine needs to get the tickets price from the ticket object.
Last edited: