Home »
MCQs »
Java MCQs
Which method is used to add a new line to file in Java?
40. Which method is used to add a new line to file in Java?
- file.addLine()
- file.nextLine()
- file.write()
- file.line()
Answer: C) file.write()
Explanation:
The file.write() method is used to add a new line to file in Java.