diff --git a/CoffeeRobot.java b/CoffeeRobot.java new file mode 100644 index 0000000..be1a75a --- /dev/null +++ b/CoffeeRobot.java @@ -0,0 +1,7 @@ +package com.company; + +public class CoffeeRobot extends Robot { + public void work(){ + System.out.println("Я CoffeeRobot - я варю каву"); + } +} \ No newline at end of file diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..61e7a3f --- /dev/null +++ b/Main.java @@ -0,0 +1,16 @@ +package com.company; + +public class Main { + + public static void main(String[] args) { + Robot robot = new Robot(); + Robot coffeeRobot = new CoffeeRobot(); + Robot robotDancer = new RobotDancer(); + Robot robotCooker = new RobotCooker(); + + robot.work(); + coffeeRobot.work(); + robotDancer.work(); + robotCooker.work(); + } +} diff --git a/Robot.java b/Robot.java new file mode 100644 index 0000000..70ab59a --- /dev/null +++ b/Robot.java @@ -0,0 +1,8 @@ +package com.company; + +public class Robot { + + public void work(){ + System.out.println("Я Robot - я просто працюю"); + } +} diff --git a/RobotCooker.java b/RobotCooker.java new file mode 100644 index 0000000..bf82ad6 --- /dev/null +++ b/RobotCooker.java @@ -0,0 +1,8 @@ +package com.company; + +public class RobotCooker extends Robot { + public void work(){ + System.out.println("Я RobotCooker - я просто готую"); + } + } + diff --git a/RobotDancer.java b/RobotDancer.java new file mode 100644 index 0000000..38773e4 --- /dev/null +++ b/RobotDancer.java @@ -0,0 +1,7 @@ +package com.company; + +public class RobotDancer extends Robot { + public void work(){ + System.out.println("Я RobotDancer - я просто танцюю"); + } +}