You need to have your PC's keyboard checked. It's Caps lock is stuck on.
Type: Posts; User: Norm
You need to have your PC's keyboard checked. It's Caps lock is stuck on.
Looks like an empty String was read into the g variable(between the = and the <). What method was used to read g?
If the code has called the next() method, there is a newline left in Scanner's...
You need to enhance your usage of println() to show what is in the String that was read. What if the String returned by nextLine() was empty? Try this:
System.out.println("g="+g+"<");
...
Please explain how that happens. Do you get any error messages?
Can you post the code where that happens and copy the console from when you executed the code.
On windows: To copy the contents of...
Please Edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.
If you are only entering one word before pressing Enter, use the nextLine()...