πŸ“Š Ruby
Q. Which of the following is correct difference between foreach and readlines?
  • (A) The method readline does not return an array.
  • (B) The method foreach does not return an array.
  • (C) readline is associated with a block
  • (D) Both A and C
πŸ’¬ Discuss
βœ… Correct Answer: (B) The method foreach does not return an array.

Explanation: The difference between the method foreach and the method readlines is that the method foreach is associated with a block. However, unlike the method readlines, the method foreach does not return an array.

Explanation by: Mr. Dubey
The difference between the method foreach and the method readlines is that the method foreach is associated with a block. However, unlike the method readlines, the method foreach does not return an array.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
213
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
95%
Success Rate