Which design pattern is used in vending machine?
UML Diagram of State Design Pattern
The Vending Machine becomes a context and stores a reference to the state. Vending Machine class will delegate all the actions that it receives to the specific state classes.