1.

What is the difference between Java and Scala?

Answer»
S.noScalaJava
1.Includes implicitIncludes WIDENING and casting
2.variables immutablevariables mutable by default
3.Pattern matchingSwitch statements
4.Allows related type to be DEFINED as one fileDoes not allow related types to be described in one file
2. What do you mean by Option in Scala and why it is used?

Option in Scala is a container that holds zero or one element of a specific type. It REPRESENTS values that either exist or do not exist. The Option is used to wrap missing values and is a REPLACEMENT to return null values. This question has the most likelihood of being ASKED in Scala interview questions for experienced professionals.



Discussion

No Comment Found