-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobot.java
More file actions
37 lines (33 loc) · 760 Bytes
/
Copy pathRobot.java
File metadata and controls
37 lines (33 loc) · 760 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
33
34
35
36
37
import java.lang.String;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Assignment 1
*
* @author melmccord
* @author rowanholop
* version 1.1
*
* This class is an abstract class that allows for our creation of robots.
*
*/
public abstract class Robot {
private String name;
private String type;
private int x;
private int y;
protected Robot(String name, String type) {
this.name = name;
this.type = type;
}
protected String speak() {
return "My name is " + name;
}
protected boolean equals(Robot r) {
if (r.name == this.name) {return true;}
else {return false;}
}
public static void main(String[] args){
}
}