java实现检查输入字符串是不是回文串

package demo;

import java.util.Scanner;

public class HuiWenShu {
	static String string;
	public static void main(String[] args) {
		Scanner scanner = new  Scanner(System.in);
		String s;
		System.out.println("请输入要检验的串:");
		string = scanner.next();
		if (huiWenChuan(string)) {
			s = "此字符串是回文串!";
		}else {
			s = "此字符串不是回文串!";
		}
		System.out.println(s);
		
	}

	private static boolean huiWenChuan(String string) {
		// TODO Auto-generated method stub
		int low = 0;
		int heigh = string.length()-1;
		while (low

你可能感兴趣的:(java)