Ok, that second fragment is to solve this problem:
say, someone decided they wanted to add 000123 to 1 (kind of strange, put a legal string input)
answer without it:
"000124"
not necessarily the...
Type: Posts; User: helloworld922
Ok, that second fragment is to solve this problem:
say, someone decided they wanted to add 000123 to 1 (kind of strange, put a legal string input)
answer without it:
"000124"
not necessarily the...
But it is an array. String are just character arrays. Oh well, for an assignment better safe than sorry.
a really random memory optimization i just thought of. You're already holding the read in number as a string, so you don't really need another copy as an integer array, just a string for the answer....
The only thin i would change after a first look is main methods generally shouldn't throw checked exceptions. Not really a problem compile wise, but if there is a checked exception, it usually should...