Articles tagged with: Read Input From User and Write to File
Java Codes »
This code example takes input from user and write the contents of the input to a file for every time the user hits the enter key.
This is continued until the user types the word ‘finished’, then the program exists. A StringBuilder is used to check whether the word ‘finished’ has been typed in.
package com.javadb.examples;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
