Why JAVA is so slow?
I'm trying to compute this problem but it take so long with java
Can anyone RUN it and show the result pls (if you have a good computer).
My result until 8 are:
public static void main(String args) throws Exception
int count = 0;
for(int j=100000000; j<=999999999; j++)
int num = j;
String str = Integer.toString(num);
String reStr = "";
for(int i=0; i<9; i++)
reStr = str.charAt(i) + reStr;
int revInt = Integer.parseInt(reStr);
count = count + 1;
Heck man, your crazy... now that I have that out of my system.
You are trying to count through almost 1billion numbers. of course it will take forever. Also, you are not printing anything out in the for loop. It's not going to do what you want. Period.
Just try to write down your logic on a paper with the each number you want to workout in the loop.