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 - я просто танцюю."); + } +}