Which class is commonly used for reading characters from a file in Java?
- FileInputReader
- FileOutputReader
- FileReader
- FileWriter
In Java, the commonly used class for reading characters from a file is FileReader. It is part of the java.io package and is specifically designed for character input. Other options like FileWriter, FileInputReader, and FileOutputReader are not standard classes in Java for file reading.
Loading...
Related Quiz
- What will be the output of the following code: int x = 10; x *= 3;?
- What will be the result of attempting to compile and run a Java class that contains a variable declared as int public;?
- What will be the result of the following Stream operation: Stream.of("a", "b", "c").filter(e -> e.contains("b")).findFirst();?
- Which of the following character stream classes should be used to read characters, arrays, and lines efficiently?
- Which method is used to execute SQL queries in JDBC?