MCPcopy Create free account
hub / github.com/Anchals24/Low-Level-Design / Vehicle

Class Vehicle

StrategyDesignPattern/WithStrategyPattern/Vehicle.java:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import BehaviouralDesignPatterns.StrategyDesignPattern.WithStrategyPattern.Strategy.DriveStrategyInterface;
3
4public class Vehicle{
5 //object create -> DriveStrategyInterface
6 DriveStrategyInterface driveStrategyObject;
7
8 //Constructor vehicle class - obj
9 Vehicle(DriveStrategyInterface driveStrategyObject) {
10 this.driveStrategyObject = driveStrategyObject;
11
12 }
13 public void drive(){
14 driveStrategyObject.drive();
15 }
16}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected