I would think that method could be as simple as:
public void addTicket() {
numTickets++;
}...where the method does exactly one thing. Raise the number of tickets by one. Methods are not...
Type: Posts; User: jps
I would think that method could be as simple as:
public void addTicket() {
numTickets++;
}...where the method does exactly one thing. Raise the number of tickets by one. Methods are not...
I'm not too sure about this section of code, for the following reasons.
1) this method returns a boolean. This method adds a ticket to the ticket count. I don't understand what the return boolean...
Any time you have repeated code, you have missed the opportunity to make a method which can be reused.
When does this return false?
When does this return true?