Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between a class and a module?



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

Post New Answer

More Ruby Interview Questions

Tell me what is the difference between calling super and calling super()?

1 Answers  


What is the difference between extend and include?

1 Answers  


Explain Ruby if-else statement?

1 Answers  


Explain about class libraries in ruby?

1 Answers  


Explain about ruby names?

1 Answers  


Explain the role of thread pooling in relation to the thread lifecycle in ruby?

1 Answers  


What is retry statement in ruby?

1 Answers  


How is visibility of methods changed in ruby?

1 Answers  


What is ruby object?

1 Answers  


Explain the difference between a single quote and double quote?

1 Answers  


Why Ruby is known as a language of flexibility?

1 Answers  


Explain about Float, Dig and Max?

1 Answers  


Categories