Find an ASCII table for the numeric char values.
The negative values are not ASCII characters.
Or use cast:
System.out.println((char)101);
Type: Posts; User: Norm
Find an ASCII table for the numeric char values.
The negative values are not ASCII characters.
Or use cast:
System.out.println((char)101);
This is what is returned by that site as bytes: [-17, -69, -65, 72, 101, 108, 108, 111]
What happens when you try a server like google?
The code works fine for me with the google site.
Do you mean it hangs after reading just one line, when trying to read the second line.
Try the code with another site's URL
Add lines like this to the code:
System.out.println("the msg");
What are the last few lines that are printed out? At what statement is the code hanging?
The print out shows that it executed Tasks 0 through 4 and then Task 5 only one time. Task 5 being in a loop should print out one time for every time around the loop.
Is that all the print out?
...
Yes, something like that would show the where the execution is hanging.
Please make a small, complete program that compile, executes and shows the problem for testing.
Copy the full text of the console from when the program is executed and paste that here also.
...