Hello,
I have been given a programming assignment, which i believe is not properly thought through.

In a string i have some numbers:

String cpr = "1234"



Now, i must test the this string contains only numbers. It is suggested that i use Character.isDigit() to check it, but then i would need to convert the string to an char - and i havent found any easy ways of doing this. Are there any other methods of testing if a string consists of only numbers??

I was also told to implement a toString method which is never used. Now, what i think is that, cpr should be a Character, and then i would use toString to convert it to string when needed, but.....not according to the teacher