S klaviaturi vvoditsya shestiznachnoe chislo proverit yavlyaetsya li ono polindromom

import java.util.Scanner;

public class Homework6 {
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
int digits=in.nextInt();
int numberOne=digits%1000000/100000;
int numberTwo=digits%100000/10000;
int numberThree=digits%10000/1000;
int numberFour=digits%1000/100;
int numberFive=digits%100/10;
int numberSix=digits%10;
if(numberOne==numberSix&&numberTwo==numberFive&&numberThree==numberFour){
System.out.println(“Polindrom”);
}
else {
System.out.println(“Ne Polindrom”);
}

}

}

Предложенное вами решение верно