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

Explain about the defined operator?

1 Answers  


What is the difference between static and dynamic scaffolding?

1 Answers  


Explain do while loop in ruby.

1 Answers  


What are Ruby iterators?

1 Answers  


What is ruby class?

1 Answers  


Tell me the role of modules and mixins in ruby?

0 Answers  


How would you implement hash in ruby internally?

1 Answers  


How to access Ruby strings elements in an application?

1 Answers  


Explain retry statement in ruby.

1 Answers  


What is the difference between ruby 1.9 and ruby 2.0?

1 Answers  


Explain about environment variables present in ruby?

1 Answers  


List some features of ruby?

1 Answers  


Categories