publicstaticbooleanziom(intnumber){StringnumStr=String.valueOf(number);if(numStr.length()!=5)thrownewIllegalArgumentException(numStr+"长度不为5");if(numStr.substring(0,1).equals(numStr.substring(4,5))&&numStr.substring(1,2).equals(numStr.substring(3,4))){returntrue;}returnfalse;} |