I'm wondering why it doesn't work, and why I cant't use the CHAR data type for variables a and b. The point is, how to compare the first and the last digits of number (pr) accordingly such way.
String a, b;
for (int i=100; i<1000;i++) {
for (int j=100; j<1000;j++) {
pr=j*i;
a = String.valueOf(pr).substring(0, 1);
b= String.valueOf(pr).substring(4, 5);
if ((a==b) ) {
System.out.println(pr);
}
}
}