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 is the difference extend and include?
Can method names be capitalized?
List some features of ruby?
Is ruby a statically typed or a dynamically typed language?
How would you create getter and setter methods in ruby?
What is mvc and why do we use it?
Explain about the command line options?
Is ruby a strongly typed or a weakly typed language?
What happens when a value is too big for fixnum?
Tell me what is the role of sub-directory app/controllers and app/helpers?
What's the difference in scope for these two variables: @name and @@name?
Explain about the defined operator?