To successfully complete this course, you should be comfortable with :
Know basic Java syntax including arrays, strings, and primitive data types
Understand how Java deals with integer and byte data as well as with arrays of these data types
classes, objects, and methods, particularly constructors and
Be able to write character-mode Java applications with
This course covers the Java platform classes used for basic I/O.
It first focuses on I/O Streams, a powerful concept that greatly simplifies I/O operations.
The course also looks at serialization, which lets a program write whole objects out to streams and read them back again.
Then the course looks at file I/O and file system operations, including random access files.
Identify correct statements about
Most of the classes covered in the I/O Streams section are in the java.io package.
Most of the classes covered in the File I/O section are in the java.io.file package.
- You can read character data from a console but not write to it.
- You can read both binary and character data from Console object but you cannot write to it.
- You can read both binary and character data from Console object but you can only write character data to it.
- You can read as well as write only character data from/to it.
Console is meant to interact with the user typically through the command/shell window and keyboard. Thus, binary data does not make sense for the console.
You can read whatever the user types using readLine() and readPassword() method. You can also acquire a Reader object using reader() method on Console object.
All these provide character data. Similarly, you can acquire PrintWriter object using writer() method on Console, which allows you to write character data to the console.