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 |
Explain the difference between a single quote and double quote?
What's the difference in scope for these two variables: @name and @@name?
How to create ruby object?
What is the difference between calling super and calling super()?
How to use sql db or mysql db. Without defining it in the database.yml
What is the use of interpolation in ruby?
What is ruby methods?
Explain about methods?
how many ways you can create a concatenating string?
What are some built-in ruby class exceptions.
Tell me what is the difference between calling super and calling super()?
What are the case statement in ruby?