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



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

Answer / Ravi Tewari

In Ruby, @name is an instance variable which belongs to a specific object instance. It has a different value for each object of the same class. On the other hand, @@name is a class variable, it is shared among all instances of the class, and it has the same value for every object of that particular class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

Explain the difference between a single quote and double quote?

1 Answers  


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

1 Answers  


How to create ruby object?

1 Answers  


What is the difference between calling super and calling super()?

1 Answers  


How to use sql db or mysql db. Without defining it in the database.yml

1 Answers  


What is the use of interpolation in ruby?

1 Answers  


What is ruby methods?

1 Answers  


Explain about methods?

1 Answers  


how many ways you can create a concatenating string?

1 Answers  


What are some built-in ruby class exceptions.

1 Answers  


Tell me what is the difference between calling super and calling super()?

1 Answers  


What are the case statement in ruby?

1 Answers  


Categories