Writing a Text File in Java
Java has plenty of classes for file manipulation. For simple text files which contains lines of text, the best classes to use are FileWriter and PrintWriter in java.io package. PrintWriter has the method println() which writes a string into the file followed by a new line. Also note that PrintWriter and FileWriter must be closed […]