Sealed Keyword in Scala

admin

6/19/2023
All Articles

undefined

Sealed Keyword in Scala

Sealed Keyword in Scala

 
 
A final modifier in Scala makes a class or trait unavailable for an extension.
On the other hand, making a class public allows any other class to extend from it.
sealed make some restriction of  class to inherit by other class in scala .