Explain the types of variables available in ruby class?
Answer / Nitesh Agrawal
Ruby classes have four types of instance variables: @variable (instance variables), @@variable (class variables), @variables (singleton class variables), and local variables. Instance variables are unique to each object, class variables are shared among all instances of a class, singleton class variables are unique to the class itself, and local variables exist only within their method or block.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to read a file in Ruby?
What is ruby methods?
Explain Ruby module?
Tell us how would you implement hash in ruby internally?
mention what is the difference between a single quote and double quote?
Explain Ruby hashes?
What are the looping structures available in ruby?
In how many ways you can compare Ruby string?
What is the use of global variable $ in Ruby?
Explain raise statement in Ruby?
Explain the role of thread pooling in relation to the thread lifecycle in ruby?
what is the difference between put and putc statement?