String date1 = "2007-10-12 18:35:00";
String date2 = "2008-10-12 18:35:00";
String pattern ="yyyy-MM-dd hh:mm:ss";
SimpleDateFormat sf = new SimpleDateFormat(pattern);
Date d1 = sfparse(date1);
Date d2 = sfparse(date2);
if(d1getTime() > d2getTime()){
Systemoutprintln("date 1 > date 2");
}else{
Systemoutprintln("date 1 < date 2");
}public static void main(String[] args) {
String time="2012-03-04";
String time1="2012-03-05";
int point=8;
String a="时间:"+time+"分数:"+point++;
String b="时间:"+time+"分数:"+point++;
String c="时间:"+time+"分数:"+point++;
String d="时间:"+time1+"分数:"+point++;
String e="时间:"+time1+"分数:"+point++;
String f="时间:"+time1+"分数:"+point++;
String g="时间:"+time1+"分数:"+point++;
List<String> sug = new ArrayList<String>();
sugadd(a);
sugadd(b);
sugadd(c);
sugadd(d);
sugadd(e);
sugadd(f);
sugadd(g);
List<String> res = new ArrayList<String>();
String exp = "";
int count = 0;
for(int i=0;i<sugsize();i++){
exp = sugget(i);
if(ressize()==0){
resadd(exp);
}else{
int size = ressize();
for(int j=0;j<size;j++){
if(resget(j)indexOf(expsplit(":")[1])>0){
count+=1;
if(IntegerparseInt(expsplit(":")[2])>IntegerparseInt(resget(j)split(":")[2])){
String tmp = "";
tmp = exp;
exp = resget(j);
resset(j, tmp);
}
}else if(j+1 == ressize()){
resadd(exp);
}
if(j+1==ressize() && count<3 && count!=3){
resadd(exp);
}
}
count = 0;
}
}
Iterator<String> it = resiterator();
while(ithasNext()){
Systemoutprintln(itnext());
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)