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


Explain about Class variable and global variable?



Explain about Class variable and global variable?..

Answer / Mohit Rajan

Class variables are variables that are defined within a class or module and share their value across all instances of the class. They are prefixed with two '@' symbols (e.g., @@my_class_var). Global variables, as mentioned earlier, can be accessed anywhere in the program without an explicit qualifier and are prefixed with '$'. While global variables have broader scope, class variables help maintain shared state across instances of a class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

How many types of associations relationships does a model has?

1 Answers  


Why Ruby is known as a language of flexibility?

1 Answers  


How does ruby deal with extremely large numbers?

1 Answers  


What does mri most commonly stand for?

1 Answers  


Explain about ruby code blocks?

1 Answers  


What is yield statement in ruby.

1 Answers  


What are ruby variables.

1 Answers  


Explain how Symbol is different from variables?

1 Answers  


Explain some of the looping structures available in ruby?

1 Answers  


Explain ruby data types.

1 Answers  


Tell me what is the role of sub-directory app/controllers and app/helpers?

1 Answers  


What is a struct in ruby?

1 Answers  


Categories