I'm having trouble trying to find the length of a int inputted. I converted the int value into a string and it works perfectly up until the user inputs any int that has more than 10 digits. The program will print out how many digits were inputted but it gives some boundary error once I put anything >10 digits
answer = in.nextInt();
answerString = String.valueOf(answer);
answerLength = answerString.length();
System.out.println(answerLength);