Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the 'sealed' keyword used for in Scala?
Answer: The 'sealed' keyword is used to restrict the inheritance of a class to the same file. It helps the compiler exhaustively check pattern matches, ensuring that all possible subclasses are covered.
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook