Print out the String's contents and length so you can see what the computer sees when it executes the code.
Type: Posts; User: Norm
Print out the String's contents and length so you can see what the computer sees when it executes the code.
At line 122 the program used a value of -1 in a call to the substring() method.
Check the code to see why it used an invalid value with substring().
The code should test the value before using it....
Please post the current version of the code.
Also copy and paste here the contents of the console from when you execute the code that shows the problem.
On windows: To copy the contents of the...
At line 40 the Scanner class's nextInt() method tried to read some data that could not be converted to an int value. The user must be careful to enter the correct data.
Also the program should...