hey guys please see the line marked with "see this line in the above code". i added this line without actually knowing what i was doing. i mean i figured out that one line was being read in without entering any line inside of the for loop which follows..so i just read that blank line outside the loop so that the user would be able to the correct number of lines...can somebody please explain why exactly a blank line is being read here?
thejwal pavithran wrote:i think i got it so just to confirm : below i am reading an int value but there is an unread EOL value..which is read in by the in.nextLine(). is my thinking right?
if so, is this the proper way to read this EOL character?
Yes, I believe that's correct, and I think that's the standard way of handling these cases with Scanner. I never use Scanner myself.