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...


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



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

Answer / Shanu Gupta

Ruby provides four types of variables: local variables, instance variables, class (or singleton) variables, and global variables.n- Local variables are used within methods and blocks. They start with a lowercase letter or an underscore (").n- Instance variables are variables that belong to instances of a class. They start with '@'.n- Class variables are shared among all instances of a class. They start with '@@'.n- Global variables are variables that can be accessed from anywhere in the program and are prefixed with $.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

How to use sql db or mysql db. Without defining it in the database.yml

1 Answers  


Tell me can you call a private method outside a ruby class using its object?

1 Answers  


What is the difference between a class and a module?

1 Answers  


what is the difference between String and Symbol?

1 Answers  


What is the difference between static and dynamic scaffolding?

1 Answers  


What is a struct in ruby?

1 Answers  


What's the difference in scope for these two variables: @name and @@name?

1 Answers  


How would you implement hash in ruby internally?

1 Answers  


How an exception is handled in Ruby?

1 Answers  


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

1 Answers  


What is the use of interpolation in ruby?

1 Answers  


How to use ruby methods.

1 Answers  


Categories