diff --git "a/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/CarMain0.java" "b/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/CarMain0.java" new file mode 100644 index 0000000..fd7c556 --- /dev/null +++ "b/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/CarMain0.java" @@ -0,0 +1,12 @@ +package week3.poly.car0; + +public class CarMain0 { + + public static void main(String[] args) { + Driver driver = new Driver(); + K3Car k3Car = new K3Car(); + driver.setK3Car(k3Car); + driver.drive(); + + } +} diff --git "a/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/Driver.java" "b/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/Driver.java" new file mode 100644 index 0000000..3a9bff8 --- /dev/null +++ "b/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/Driver.java" @@ -0,0 +1,18 @@ +package week3.poly.car0; + +public class Driver { + + private K3Car k3Car; + + public void setK3Car(K3Car k3Car) { + this.k3Car = k3Car; + } + + public void drive() { + System.out.println("자동차를 운전합니다."); + k3Car.startEngine(); + k3Car.pressAccelerator(); + k3Car.offEngine(); + } + +} diff --git "a/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/K3Car.java" "b/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/K3Car.java" new file mode 100644 index 0000000..63deabc --- /dev/null +++ "b/\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/K3Car.java" @@ -0,0 +1,16 @@ +package week3.poly.car0; + +public class K3Car { + + public void startEngine() { + System.out.println("K3Car.startEngine"); + } + + public void offEngine() { + System.out.println("K3Car.offEngine"); + } + + public void pressAccelerator() { + System.out.println("K3Car.pressAccelerator"); + } +}