LLD - Behavioral Design Patterns — Part 1
Consider the following code snippet:
What will be the output when this code runs?
class Door {
void open() { print('Door opened'); }
void close() { print('Door closed'); }
}
class DoorOpenCommand implements Command {
Door door;
DoorOpenCommand(this.door);
void execute() { door.open(); }
}
void main() {
Door door = Door();
Command command = DoorOpenCommand(door);
command.execute();
}What will be the output when this code runs?
