public class policemanAndThief {
int x, y;
Boolean isCatched = false;
/**
* */
public static void main(String[] args) {
policemanAndThief pt = new policemanAndThief();
Policeman p = pt.new Policeman("YiJichangkong");
Thief t = pt.new Thief("Liu du du");
p.start();
t.start();
}
public class Policeman extends Thread {
Policeman() {
super();
}
Policeman(String s) {
super(s);
}
public void run() {
while (true) {
for (x = -100; x <= 100; x += (int) (Math.random() * 6 + 1)) {
System.out.println("Police " + this.getName() + " are at: "
+ x);
/*
* try { this.sleep((int)(Math.random()3000+