the code does work fine, bearing in mind it was 2:30 on me doing it, the toChar method is pointless i see it now ive changed it, the output i get is attatched. ive not corrected everything is it works fine even if its not to "java convention"
thanks Lee
Then let me tell you this again: The code you provided here does not compile. There is at least one curly bracket and a return statement missing in the end.
I didn't say that it doesn't run on your machine. Maybe something went wrong with copy&paste or whatever, but it doesn't work, no matter what you tell me.
And now to the working right part: That it works right for one input, doesn't mean it works right for every input. Testing can never tell you the absence of bugs. It only might tell you the presence.
However I can't prove anything, because your code doesn't compile.
Of course it works although you didn't care for java code conventions. You didn't even look what they are for, did you? Otherwise you would know that this has nothing to do with each other.