Vidyalelo
Java Programming · Q21

Input Output

Programming · Java Programming · question 21

Q21

In Java, how can you check if a file or directory exists using the `File` class?

A.
By using the `createNewFile()` method
B.
By using the `read()` method
C.
By using the `exists()` method
Answer
D.
By using the `write()` method

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board