Head-First-Design-Patterns icon indicating copy to clipboard operation
Head-First-Design-Patterns copied to clipboard

A mistake of HasQuarterState.java in gumballstate and gumballstatewinner

Open newryu opened this issue 3 years ago • 0 comments

state\gumball\GumballMachine.java Line 75: "No gumball dispensed" should be "You need to turn the crank"

state\gumballstate\HasQuarterState.java Line 27: "No gumball dispensed" should be "You need to turn the crank"

state\gumballstatewinner\HasQuarterState.java Line 33: "No gumball dispensed" should be "You need to turn the crank"

Just check Page 387 in the book, the dispense method when state is HAS_QUARTER

else if (state == HAS_QUARTER) {System.out.println("You need to turn the crank");}

the following warning messages of dispense method when the state is HAS_QUARTER in Chapter 10 need to be the same.

So the message "No gumball dispensed" of HAS_QUARTER state on Page 400, Page 410, Page 422 should be "You need to turn the crank".

newryu avatar Jul 07 '22 02:07 newryu