求助:java中判断字符串回文 问个菜鸟问题,怎么判断字符串是回文,给程序最好了。谢谢了。java中判断字符串回文 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 package com.bob.abstraction.recursion;/** * <p>Title: 回文测试</p> * * <p>Description: 递归的方法测试一个输入的字符串是否为回文</p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */public class isPal { private String stringItem; private boolean flag = false; public isPal() { } public boolean execute(String item) { if (item.length() == 0 || item.length() == 1) { this.flag = true; } else if (item.substring(0, 1).equals(item.substring(item.length() - 1, item.length()))) { execute(item.substring(1, item.length() - 1)); } else { this.flag = false; } return this.flag; } public static void main(String para[]) { isPal a = new isPal(); System.out.println(a.execute("1212313")); }} 自定义JTextField组件问题 jsp中,${}与%{} 一段java代码,编译能行,但是运行的时候就出现一些问题代码。把鼠标点击事件里的循环注掉就没事。请各位好心大侠指导下,谢谢 static final变量存储内存哪个区? java的版本问题? 高难? 请问我下载什么编译器啊????? repaint()和repaintComponent()以及线程的问题 Java中有类似VB中的IIF的语句吗? 在线等待,大问题??????????? 期盼 LDAP的效率高在哪里?? 急问,applet连oracle的一些问题,进来看看吧
* <p>Title: 回文测试</p>
*
* <p>Description: 递归的方法测试一个输入的字符串是否为回文</p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class isPal { private String stringItem; private boolean flag = false; public isPal() { } public boolean execute(String item) { if (item.length() == 0 || item.length() == 1) { this.flag = true; } else
if (item.substring(0,
1).equals(item.substring(item.length() - 1, item.length()))) { execute(item.substring(1, item.length() - 1)); } else { this.flag = false; } return this.flag;
} public static void main(String para[]) { isPal a = new isPal();
System.out.println(a.execute("1212313")); }}