Vidyalelo
Ruby Programming · Q24

Blocks and Procs in Ruby

Programming · Ruby Programming · question 24

Q24

Which of the following is true about the stability of variables within a block in Ruby?

A.
Variables defined outside the block can be modified within the block
B.
Variables defined inside the block can be modified outside the block
C.
Variables defined within the block cannot be modified inside the block
D.
Variables defined within the block cannot be modified outside the block
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board