The byte pattern in the before printout:
shows two ? at the start of the line followed by alternating chars and "spaces".
I recognize this as the pattern for a UTF16 file.
Here is the printout...
Type: Posts; User: Norm
The byte pattern in the before printout:
shows two ? at the start of the line followed by alternating chars and "spaces".
I recognize this as the pattern for a UTF16 file.
Here is the printout...
Does the input txt file use UTF16 encoding?
If so, the constructor for the Scanner class needs to be told that:
Scanner scnr = new Scanner(is, "UTF16"); //<<<<<<< needs...
What are these values shown in the printout?
47
0
0
The print statement should have a small String before the value that is printed so you know what it is the value of. Like you did here:...
Where is the col=0 value printed? What was the value in line?
Add this statement to the code after the statement that assigns a value to line:
System.out.println("col="+ col + ", line=" +...
Did you print out the values of line and col as I suggested?
What was printed?
Note: a null value is NOT the same as an empty String: ""
What are the values in the variables used in line 86? What is in line and what is in col?
Add a print statement before line 86 that prints out those two variables' values.
The error message says...