This is what I understood so far.
Classes should be used when we need instantialte objects.
We use "Objects" only when we have a singleton requirement, meaning that there is no need for multiple instances of "objects". I think that when we create common library functions or utility functions in a project, we can use "objects" in such a way that we need to create instances every time we use methods / functions in this object.
Classes of classes can be used when we want to save boilerplate code. Say we have a class of "Stock". Each stock as a whole has hundreds of member variables. Instead of writing developer code for setters and getters, if we have a case class, it generates a lot of code by default.
Features: do not know when to use. Both parameters and objects do not accept parameters during initialization.
Any thoughts and ideas are kindly shared.
source
share