它说我找不到符号...我不知道怎么了

时间:2019-11-29 18:08:40

标签: java compiler-errors java.util.scanner

import java.util.Scanner;
public  class PolidromNumberChecker{
    static String input=new Scanner(System.in).nextLine();
    static public void Reverse(){    
        char[] try1 = input.toCharArray();   
        for (int i = try1.length-1; i>=0; i--) {
            System.out.print(try1[i]); }
        if(input.equals(input.Reverse())){
                System.out.println(input+"is a polidrom number") ; 
       }else{
                System.out.println(input+"is not  a polidrom number") ; 
                                         }

    } 
    public static void main(String[] args){
        Reverse();      

    }


}

PolidromNumberChecker.java:18:错误:不能         if(input.equals(input.Reverse())){                              ^   符号:方法Reverse()   location:字符串类型的变量输入 1个错误

0 个答案:

没有答案