Multiple choice technology programming languages

Does File class have any method to read or write content in a file?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The File class in Java represents file and directory pathnames abstractly but does not provide methods to read or write file contents. It only manipulates file metadata (existence, deletion, path operations). For actual I/O operations, you need stream classes like FileReader, FileWriter, BufferedReader, or Files utilities.