package demo;
import java.util.ArrayList;
import java.util.List;
public class SingleTwo {
/**
* 例如:list中包含若干对象 去除list中非User的对象
* 假如:list中User对象的(name和id) 与list其他User对象的(name和id)相同
* 则视为这两对象为重复需要去重复(name和id)不区分大小写(不允许修改User的构造方法)
* @return
*/
public List execute(List list){
return new ArrayList();
}
}
package demo;
public class User {
private String id;
private String name;
private double plance;
public User() {
super();
// TODO Auto-generated constructor stub
}
public User(String id, String name) {
super();
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPlance() {
return plance;
}
public void setPlance(double plance) {
this.plance = plance;
}
}
添加回答
举报
0/150
提交
取消