Q. Which method is used to add a new line to file in Java?

  • (A) file.addLine()
  • (B) file.nextLine()
  • (C) file.write()
  • (D) file.line()
πŸ’¬ Discuss
βœ… Correct Answer: (C) file.write()
Explanation: The file.write() method is used to add a new line to file in Java.
Explanation by: Team MCQ Buddy
The file.write() method is used to add a new line to file in Java.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
326
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
87%
Success Rate