下面是代码,该段只是简单地比较两个字符串,并返回真或假:
boolean eq = Fori.commends.get(39).equals(Fori.commends.get(40));
if ( eq ){
System.out.println(
"40 and 41 are match " + Fori.commends.elementAt(39) + Fori.commends.elementAt(40));}
else {
System.out.println("not match "+ "40: " + Fori.commends.elementAt(39));
System.out.println("not match "+ "41: " + Fori.commends.elementAt(40));
}
输出如下:
eq is false
not match 40: 11111111111111111111111111111111
not match 41: 11111111111111111111111111111111