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 are the ruby variables?

1 Answers  


What is concatenating string in ruby. In how many ways you can create a concatenating string.

1 Answers  


Explain about garbage collection feature of ruby?

1 Answers  


Explain retry statement in ruby.

1 Answers  


What are the looping structures available in ruby?

1 Answers  


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

1 Answers  


What does irb stand for?

1 Answers  


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

1 Answers  


Do you know about dig, float and max?

1 Answers  


How would you freeze an object in ruby?

1 Answers  


What are the case statement in ruby?

1 Answers  


Explain the role of thread pooling in relation to the thread lifecycle in ruby?

1 Answers  


Categories