Vidyalelo
Ruby Programming · Q2

Blocks and Procs in Ruby

Programming · Ruby Programming · question 2

Q2

How do you define a block in Ruby?

A.
By using the keyword block followed by square brackets []
B.
By using the keyword block followed by parentheses ()
C.
By defining a method with the keyword block
D.
By enclosing code within curly braces {}
Answer

Answer: Option D

Solution

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