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 the difference in scope for these two variables: @@name and @name?



Explain the difference in scope for these two variables: @@name and @name?..

Answer / Madan Lal

@@name is a class variable, which means it is shared among all instances of a class. It has a global scope within that class and its subclasses. @name, on the other hand, is an instance variable, which means it is unique to each individual object created from the class. Each object will have its own @name variable.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

what is the difference extend and include?

1 Answers  


Can method names be capitalized?

1 Answers  


List some features of ruby?

1 Answers  


Is ruby a statically typed or a dynamically typed language?

1 Answers  


How would you create getter and setter methods in ruby?

1 Answers  


What is mvc and why do we use it?

1 Answers  


Explain about the command line options?

1 Answers  


Is ruby a strongly typed or a weakly typed language?

1 Answers  


What happens when a value is too big for fixnum?

1 Answers  


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

1 Answers  


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

1 Answers  


Explain about the defined operator?

1 Answers  


Categories