Hi,
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:
String newFileName;
String line;
PrintWriter outputStream = new PrintWriter(newFileName);
while( line.length()>0){
line = keyboard.next();
outputStream.println(line);
}
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