Write a Ticket class that gives each new ticket the next number, starting at 1. Two tickets made in a row get 1 and 2. getNumber returns this ticket’s number. A static field is shared by every object of the class, which is what makes this work.
class Ticket { Ticket(); int getNumber(); }
Examples
There are also 2 hidden tests you can't see. Solve the problem, not the examples.