Command Design Pattern

Definition:
The Command pattern is a behavioral design pattern in which a request is encapsulated as an object. This object contains all…