Hi, was wondering where im going wrong, any ideas?
Modifying variable value from method
Implement a method empty() in the TicketMachine class that simulates the effect of removing all money from the machine It should have a void return type and the body should simply set the total variable/field to zero.
Does this method need any parameters? No
Is this method a mutator or accessor? mutator
Paste the whole method into the space below
public void empty(int return)
{
balance = 0;
}
Mark: 0 out of 3
Comments:
* Test 1 (0.0 out of 3)
TicketMachine.java:26: <identifier> expected
public void empty(int return)
^
TicketMachine.java:60: ')' expected
}
^
2 errors
The output should have been:
No it doesn't need parameters
and it is a mutator
TicketMachine emptied successfully
This is what was actually produced:
Exception in thread "main" java.lang.NoClassDefFoundError: TicketMachine