Winston GutkowskiAs Matthew said: sounds perfectly reasonable; and that first bit can be done in one line with BigInteger. And if you have a String, then the second part of that idea is theoretically redundant, because String has a [tt wrote:charAt(int)[/tt] method; although a for-each loop using String.toCharArray() might be more readable.
Matthew Brown wrote:You need to have a look at the BigInteger class. That stores integers of arbitrary size.
That particular Project Euler problem is trivial in languages that have a BigInteger type or similar. You've got to go to much more trouble if you don't have it - think about how you might implement your own BigInteger if you had to!
Campbell Ritchie wrote:
That is poor advice. You should create your own folder for your own work. Otherwise you can lose all your work when you upgrade Java.Komal Arora wrote: . . . save it as a .java file in the bin folder of jdk. . . .