A

Admin • 833K Points
Coach

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
  • Correct Answer - Option(B)
  • Views: 16
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin

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.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.