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 use of global variable $ in Ruby?



What is the use of global variable $ in Ruby?..

Answer / Sudha Devi

$ is a prefix for global variables in Ruby. It means that any variable prefixed with a $ sign can be accessed from anywhere within your program. However, it's generally discouraged to use global variables as they can lead to naming conflicts and make code harder to manage.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

What are the object-oriented programming features supported by ruby?

1 Answers  


Do you know when self.up and self.down method is used?

1 Answers  


In how many ways you can compare Ruby string?

1 Answers  


How will you rename and delete a file in Ruby?

1 Answers  


Explain ruby data types.

1 Answers  


In how many ways items can be removed from array in Ruby?

1 Answers  


How does ruby deal with extremely large numbers?

1 Answers  


How to check whether a directory exist or not in Ruby?

1 Answers  


Tell us what is class libraries in ruby?

1 Answers  


Tell me how can you declare a block in ruby?

1 Answers  


How is an iterator handled in ruby?

1 Answers  


Can method names be capitalized?

1 Answers  


Categories