What is the correct way to close a file in Java after writing to it?

RPSC Programmer 2024

What is the correct way to close a file in Java after writing to it?

  1. A.

    fileInput.close();

  2. B.

    file.close();

  3. C.

    fileWriter.close();

  4. D.

    fileStream.close();

  5. E.

    Question not attempted

Attempted by 445 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…