adplus-dvertising
frame-decoration

Question

What is a notable difference between local variables and other variable types in Ruby?

a.

Local variables are global in scope.

b.

Local variables exist only within the context of the code.

c.

Local variables cannot store numeric values.

d.

Local variables always require explicit data type declaration.

Answer: (b).Local variables exist only within the context of the code. Explanation:Local variables in Ruby exist only within the context of the code where they are declared.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is a notable difference between local variables and other variable types in Ruby?