Q. Which method in java is used to read lines from file?

  • (A) file.read()
  • (B) file.nextLine()
  • (C) file.getLine()
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) file.getLine()
Explanation: The file.getLine() method is used to read lines from a file.
Explanation by: Team MCQ Buddy
The file.getLine() method is used to read lines from a file.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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