In this phrase, we show how you can create a BufferedReader for reading input from a file specified by a filenamein this case somefile.txtand how you can create a BufferedWriter for writing text to an output file specified by name, afile.txt. It is very easy to open a file by name in Java. Most of the input and output stream and reader classes you will use have an option of specifying the file by name in the stream or reader's constructor. |