Created
February 19, 2023 14:31
-
-
Save evrentan/b5830d0db7e3d9e0bdf11bf632493fa0 to your computer and use it in GitHub Desktop.
Main Class for Bridge Design Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bridge.VehicleManager; | |
import impl.VehicleImpl; | |
import java.util.Scanner; | |
public class BridgeDesignPattern { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.print("Enter the model of your vehicle: "); | |
final String model = scanner.next(); | |
System.out.print("Enter the manufacture year of your vehicle: "); | |
final int manufactureYear = scanner.nextInt(); | |
scanner.close(); | |
VehicleManager vehicleManager = new VehicleManager(); | |
vehicleManager.vehicle = new VehicleImpl(manufactureYear, model); | |
System.out.println(String.format("Your %s is %d years old !!!", vehicleManager.getModel(), vehicleManager.getAge())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment