scala – difference between class object

Mention the difference between an object and a class ?

A class is a definition for a description.  It defines a type in terms of methods and composition of other types.  A class is a blueprint of the object. While, an object is a singleton, an instance of a class which is unique.

Leave a comment