1.

When Compare To Normal Class, What Are The Major Advantages Or Benefits Of A Case-class?

Answer»

The following are the major advantages or benefits of a Case CLASS over Normal Classes:

  • Avoids lots of boiler-plate code by adding some useful METHODS automatically.
  • By default, supports IMMUTABILITY because it’s parameters are ‘val’
  • Easy to USE in Pattern Matching.
  • No need to use ‘new’ keyword to CREATE instance of Case Class.
  • By default, supports Serialization and Deserialization.

The following are the major advantages or benefits of a Case class over Normal Classes:



Discussion

No Comment Found