Home » JAVA Programming » Files and I/O » Question
  1. Which of these values is returned by read() method is end of file (EOF) is encountered?
    1. -1
    2. 1
    3. 0
    4. Null
    5. None of these
Correct Option: A

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.



Your comments will be displayed only after manual approval.