Introduction Java Readers and Writers
Java Readers and Writers is the second course in the Networking with Java
This course teaches you how to manipulate files and how to use the Reader and Writer classes to read and write text files.
In addition, you will learn about characters sets and encodings that allow Java to deal with those character sets.
After completing this course, you will be able to
- Manipulate files separately from their contents
- Determine information about a file
- Use the
FileDialog class to choose files
- Connect readers and writers to input and output streams
- Use readers and writers to read and write strings and character arrays
BufferedReaders to read text files one line at a time and use
BufferedWriters to efficiently output them
- Write filter readers and writers that manipulate text before passing it on
While Java Readers and Writers
does not deal directly with network programming, it covers skills that are prerequisite for anyone interested in writing programs that communicate over networks.
The Networking with Java
series progresses from courses teaching these prerequisite skills to courses dealing specifically with writing Java programs that communicate over networks.
This course should take you approximately 15 hours to complete. You can expect to spend 15 to 30 minutes on each lesson. Some lessons will take you longer, especially if there is an exercise to submit, and others may take 10 minutes.
These numbers are only estimates and your pace through the course is entirely up to you.
Before you start the course, here is a short quiz question to test your knowledge of File I/O Fundamentals.
Which of the following methods are valid methods in the Java File Class.(Choose three options)
public class File extends Object implements Serializable, Comparable <File >
- Changes the current working directory:
- Deletes a file :
- Creates a file :
- Renames a file
- Makes a directory :
Answer: C, D, E
Explanation: Correct answers are options C, D and E. The File class does not provide any methods to change the current working directory.
delete() method attempts to delete a file or a directory and the
createNewFile() method creates a new empty disk file.
renameTo() method can be used to rename a file or a directory and the
mkdir() method attempts to create a new directory.
Please visit the sitemap, which contains all the links for the courses and modules on this website.
In the next few brief lessons, you will find out about course prerequisites, the course project, and what you need to get the most out of this course.