From 28f3dbd95dcc3e2ddd4b69c96da1d51a4cbcd20f Mon Sep 17 00:00:00 2001 From: toychip Date: Wed, 14 Feb 2024 04:12:35 +0900 Subject: [PATCH] =?UTF-8?q?[Week3][Chap11]=20=EB=8B=A4=ED=98=95=EC=84=B1?= =?UTF-8?q?=20-=20=EC=97=AD=ED=95=A0=EA=B3=BC=20=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?=EC=98=88=EC=A0=9C1=20(#26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/week3/poly/car0/CarMain0.java" | 12 ++++++++++++ .../src/main/java/week3/poly/car0/Driver.java" | 18 ++++++++++++++++++ .../src/main/java/week3/poly/car0/K3Car.java" | 16 ++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 "\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/CarMain0.java" create mode 100644 "\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/Driver.java" create mode 100644 "\354\236\204\354\244\200\355\230\225/java-basic/src/main/java/week3/poly/car0/K3Car.java" 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"); + } +}