-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRobot.java
More file actions
32 lines (27 loc) · 704 Bytes
/
Robot.java
File metadata and controls
32 lines (27 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package typeinfo;
import java.util.*;
import net.mindview.util.*;
/**
* RUN:
* javac typeinfo/Robot.java
* OUTPUT:
*
*/
public interface Robot {
String name();
String model();
List<Operation> operations();
class Test {
public static void test(Robot r) {
if (r instanceof Null) {
System.out.println("[Null Robot]");
}
System.out.println("Name: " + r.name());
System.out.println("Model: " + r.model());
for (Operation operation : r.operations()) {
System.out.println(operation.description());
operation.command();
}
}
}
}