What is the difference between a class and a module?
Answer / Dharmendra Yadav
In Ruby, both classes and modules are namespaces for organizing code. However, a class is used to define a new data type or object-oriented behavior, whereas a module encapsulates reusable functionality (methods and constants) that can be mixed into existing classes using the `include` or `extend` keywords.
| Is This Answer Correct ? | 0 Yes | 0 No |
Tell me what is the difference between calling super and calling super()?
What is the difference between extend and include?
Explain Ruby if-else statement?
Explain about class libraries in ruby?
Explain about ruby names?
Explain the role of thread pooling in relation to the thread lifecycle in ruby?
What is retry statement in ruby?
How is visibility of methods changed in ruby?
What is ruby object?
Explain the difference between a single quote and double quote?
Why Ruby is known as a language of flexibility?
Explain about Float, Dig and Max?