Home / Interview / Scala :: General Questions

Interview :: Scala

61) What are case classes in Scala?

Scala case classes are just regular classes which are immutable by default and decomposable through pattern matching. It uses the equal method to compare instance structurally. It does not use the new keyword to instantiate the object.

Example

62)

What is file handling in Scala?

File handling is a mechanism for handling file operations. Scala provides predefined methods to deal with the file. You can create, open, write and read the file. Scala provides a complete package scala.io for file handling.

Example