I am on euler project 4, the largest palendrome product of 2 3digit numbers.
Here is the program, however it doesn't print a value.
please help.
package euler;
public class problem004 {
String reversed;
public static void main(String[] args) {
int product =0;
String stringproduct;
//cycles through all the numbers
for(int i=999;i>=100;){
for(int n=999;n>=100;){
product = n*i;
stringproduct = product +"";
new problem004().reverse(stringproduct);
//if the string is a palendrome
if(stringproduct == new problem004().reversed){
System.out.println("answer is"+stringproduct);
}
n--;
}
i--;
}
}
//reverses the string order
void reverse(String rev){
//""turns it to a string
reversed = new StringBuffer(rev).reverse() + "";
}
}