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
7 changes: 7 additions & 0 deletions CoffeeRobot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.company;

public class CoffeeRobot extends Robot {
public void work(){
System.out.println("Я CoffeeRobot - я варю каву");
}
}
16 changes: 16 additions & 0 deletions Main.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
8 changes: 8 additions & 0 deletions Robot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.company;

public class Robot {

public void work(){
System.out.println("Я Robot - я просто працюю");
}
}
8 changes: 8 additions & 0 deletions RobotCooker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.company;

public class RobotCooker extends Robot {
public void work(){
System.out.println("Я RobotCooker - я просто готую");
}
}

7 changes: 7 additions & 0 deletions RobotDancer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.company;

public class RobotDancer extends Robot {
public void work(){
System.out.println("Я RobotDancer - я просто танцюю");
}
}