Posted on 2008-03-12 08:58
KAY 阅读(408)
评论(0) 编辑 收藏
public class StringTest{
public boolean Juage(String str) {
boolean flag = false;
char attr[] = str.toCharArray();
for (int i = 0; i < attr.length; i++) {
if (attr[i] == attr[attr.length -1- i]) {
flag = true;
continue;
} else {
flag = false;
break;
}
}
return flag;
}
public static void main(String[] args) {
boolean flag=new StringTest().Juage("abc@cba");
System.out.println(flag);
}
}