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 things we can define in the model?

1 Answers  


Tell me how would you freeze an object in ruby? Can you provide a simple example?

1 Answers  


Name different methods for io console in ruby?

1 Answers  


What are the different uses of ruby modules?

1 Answers  


Explain ruby strings.

1 Answers  


Explain ruby ranges. What are the ways to define ranges?

1 Answers  


Define ruby methods.

1 Answers  


Explain case statement in Ruby?

1 Answers  


Explain the concepts and capabilities of garbage collection feature of Ruby?

1 Answers  


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

1 Answers  


What must you do first before you can invoke an unboundmethod object?

1 Answers  


Ruby support single inheritance/multiple inheritance or both?

1 Answers  


Categories