I'm trying to write a program that asks the user to enter a series of text lines and then stop and write those lines into a text file.
I tried to use this:
PrintWriter outputStream = new PrintWriter(newFileName);
line = keyboard.next();
But the while loop does not stop when the user enters an empty line (which by the way I have no idea what it is and how java recognize an empty line. help with that is also appreciated)
any other ways to do this? (take input from user and write it to a file)
thanks a million
Edited 6 Years Ago by jad0521: n/a