Which method is used to read a single character from a character input stream in Java?
- read()
- readChar()
- readCharacter()
- readLine()
The read() method in Java's character input stream classes is used to read a single character at a time. It returns an integer representing the Unicode code point of the character read. The other options are not valid methods for reading a single character from a character input stream.
Loading...
Related Quiz
- Which of the following sorting algorithms is most efficient in terms of average-case time complexity?
- If a superclass has a protected field, will subclasses in different packages have direct access to it?
- When using a single-thread executor, what happens if a submitted task throws an exception?
- To execute a batch of commands, we use the ________ method.
- The keyword ________ is used to apply restrictions on class, method, and variable.