本文共 1280 字,大约阅读时间需要 4 分钟。
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 模拟
* @author PC504
*
*/
public class Imitate {
private Date date;//时间
private String adress;//地点
private Person person;//人物
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getAdress() {
return adress;
}
public void setAdress(String adress) {
this.adress = adress;
}
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
/**
* 事故模拟现场开始
*/
public void imitateStart(){
Imitate imitate = new Imitate();
Person hero = new Person("李启铭","单位实习生","河北省保定市河北大学");
Person studentA = new Person("陈某","学生","河北省保定市河北大学");
Person studentB = new Person("张某","学生","河北省保定市河北大学");
List personList = new ArrayList();
personList.add(studentA);
personList.add(studentB);
if(imitate.accidentIsflee(person, personList)){
System.out.println("逮捕");
}else{
System.out.println("天网恢恢。疏而不漏");
}
}
/**Mo
*
* @param person 肇事者
* @param personList 受害者
* @return
*/
public boolean accidentIsflee(Person person,List personList){
Car car = new Car();
car.accident(person, personList); //事故现场再现
Person publicSecurity = new Person("保安","治安","河北大学");//保安出现
person.say("我爸是李刚");
return publicSecurity.manage(person); //是否逃离
}
}
?
转载地址:http://hlodl.baihongyu.com/