-1

Why does the case class in Scala needs to have compulsory parenthesis().

      case class TestCase() {} 

Why it cannot be like below:

      case class TestCase {}
ZAHEER AHMED
  • 487
  • 1
  • 4
  • 8
  • 7
    Possible duplicate of [Why were the case classes without a parameter list deprecated?](http://stackoverflow.com/questions/2254710/why-were-the-case-classes-without-a-parameter-list-deprecated) – Sparko Jan 01 '16 at 07:59
  • Hmm went through the thread, but it does not give the exact answer. If you have details can you share here – ZAHEER AHMED Jan 01 '16 at 11:57

1 Answers1

1

This is to avoid mistakes. If you have a case class without args it means all case classes that you create will be identical so in most cases what you really mean is to do case object

Maxim
  • 7,138
  • 1
  • 30
  • 44