Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/CoffeRobot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class CoffeRobot extends Robot {
@Override
void work(){
System.out.println("Я CoffeRobot – я варю каву");
}
}
13 changes: 13 additions & 0 deletions src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class Main {

public static void main(String[] args) {
Robot robot = new Robot();
CoffeRobot coffeRobot = new CoffeRobot();
RobotDancer robotDance = new RobotDancer();
RobotCoocker robotCoock = new RobotCoocker();
robot.work();
coffeRobot.work();
robotDance.work();
robotCoock.work();
}
}
5 changes: 5 additions & 0 deletions src/Robot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class Robot {
void work(){
System.out.println("Я Robot - я просто працюю");
}
}
6 changes: 6 additions & 0 deletions src/RobotCoocker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class RobotCoocker extends Robot {
@Override
void work() {
System.out.println("Я RobotCoocker – я просто готую");
}
}
6 changes: 6 additions & 0 deletions src/RobotDancer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class RobotDancer extends Robot {
@Override
void work() {
System.out.println("Я RobotDancer – я просто танцюю");
}
}