From 198675ef58f5840ef26ac3e3b60673cdbc528ae8 Mon Sep 17 00:00:00 2001 From: Oleksii <52570864+AlexU238@users.noreply.github.com> Date: Fri, 19 Jul 2019 15:17:50 +0300 Subject: [PATCH] Robot by @AlexU238 --- CoffeRobot.java | 7 +++++++ Main.java | 15 +++++++++++++++ Robot.java | 7 +++++++ RobotCooker.java | 7 +++++++ RobotDancer.java | 7 +++++++ 5 files changed, 43 insertions(+) create mode 100644 CoffeRobot.java create mode 100644 Main.java create mode 100644 Robot.java create mode 100644 RobotCooker.java create mode 100644 RobotDancer.java diff --git a/CoffeRobot.java b/CoffeRobot.java new file mode 100644 index 0000000..6babbff --- /dev/null +++ b/CoffeRobot.java @@ -0,0 +1,7 @@ +public class CoffeRobot extends Robot{ + + @Override + public void work() { + System.out.println("Я CoffeRobot - я варю каву."); + } +} diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..4a9c0db --- /dev/null +++ b/Main.java @@ -0,0 +1,15 @@ +public class Main { + + public static void main(String [] args){ + Robot robot = new Robot(); + Robot barista = new CoffeRobot(); + Robot dancer = new RobotDancer(); + Robot cook = new RobotCooker(); + + robot.work(); + barista.work(); + dancer.work(); + cook.work(); + } + +} diff --git a/Robot.java b/Robot.java new file mode 100644 index 0000000..e6832ef --- /dev/null +++ b/Robot.java @@ -0,0 +1,7 @@ +public class Robot { + + public void work(){ + System.out.println("Я Robot - я просто працюю."); + }; + +} diff --git a/RobotCooker.java b/RobotCooker.java new file mode 100644 index 0000000..933853c --- /dev/null +++ b/RobotCooker.java @@ -0,0 +1,7 @@ +public class RobotCooker extends Robot { + + @Override + public void work() { + System.out.println("Я RobotCooker - я просто готую."); + } +} diff --git a/RobotDancer.java b/RobotDancer.java new file mode 100644 index 0000000..dbf06bb --- /dev/null +++ b/RobotDancer.java @@ -0,0 +1,7 @@ +public class RobotDancer extends Robot{ + + @Override + public void work(){ + System.out.println("Я RobotDancer - я просто танцюю."); + } +}