State design pattern is used when an Object changes its behavior based on its internal state . If we have to change behavior of an object based on its state, we can have a state variable in the Object and use if-else condition block to perform different actions based on the state.1 Eyl 2021