Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the scope of a local variable in ruby?



What is the scope of a local variable in ruby?..

Answer / Deepika Sengar

In Ruby, local variables have block scope. This means they are accessible within the same method or block they were defined unless explicitly declared as global (using $ before variable name).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Are ruby strings are mutable?

1 Answers  


What are the key features of ruby?

1 Answers  


As you know ruby provides four types of variables. List them and provide a brief explanation for each?

1 Answers  


what is Interpolation in Ruby?

1 Answers  


Explain until loop in ruby.

1 Answers  


Who is the developer of Ruby?

1 Answers  


what is the difference extend and include?

1 Answers  


Explain Ruby exceptions?

1 Answers  


Please explain what is mvc and why do we use it?

1 Answers  


In Ruby code, often it is observed that coder uses a short hand form of using an expression like array.map(&:method_name) instead of array.map { |element| element.method_name }. How this trick actually works?

1 Answers  


Explain the garbage collection feature of ruby?

1 Answers  


Explain the difference between a single quote and double quote?

1 Answers  


Categories