Q. Which of the following is correct difference between foreach and readlines?
β
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.