Explain about Class variable and global variable?
Answer / Mohit Rajan
Class variables are variables that are defined within a class or module and share their value across all instances of the class. They are prefixed with two '@' symbols (e.g., @@my_class_var). Global variables, as mentioned earlier, can be accessed anywhere in the program without an explicit qualifier and are prefixed with '$'. While global variables have broader scope, class variables help maintain shared state across instances of a class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain about the defined operator?
What is the difference between static and dynamic scaffolding?
Explain do while loop in ruby.
What are Ruby iterators?
What is ruby class?
Tell me the role of modules and mixins in ruby?
How would you implement hash in ruby internally?
How to access Ruby strings elements in an application?
Explain retry statement in ruby.
What is the difference between ruby 1.9 and ruby 2.0?
Explain about environment variables present in ruby?
List some features of ruby?