Files and I/O
- Which of these methods are used to read in from file?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Each time read() is called, it reads a single byte from the file and returns the byte as an integer value. read() returns -1 when the end of the file is encountered.
- Which of these exception is thrown in cases when the file specified for writing is not found?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
In cases when the file specified is not found, then FileNotFoundException is thrown by java run-time system, earlier versions of java used to throw IOException but after Java 2.0 they throw FileNotFoundException.
- Which of these class contains the methods used to write in a file?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
FileInputStream
- Which of these class is used to read from a file?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
FileInputStream
- Which of these classes are used by character streams output operations?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Character streams uses Writer and Reader classes for input & output operations.