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 |
What are the ruby variables?
What is concatenating string in ruby. In how many ways you can create a concatenating string.
Explain about garbage collection feature of ruby?
Explain retry statement in ruby.
What are the looping structures available in ruby?
What's the difference in scope for these two variables: @name and @@name?
What does irb stand for?
what is the role of sub-directory app/controllers and app/helpers?
Do you know about dig, float and max?
How would you freeze an object in ruby?
What are the case statement in ruby?
Explain the role of thread pooling in relation to the thread lifecycle in ruby?