1.

What Is The Equivalent Construct Of Scala’s Option In Java Se 8? What Is The Use Of Option In Scala?

Answer»

Scala’s Option is similar to Java SE 8’s OPTIONAL. Java SE 8 has introduced a new utility class Optional to REPRESENT existing or non-existing of some value. Optional is AVAILABLE in java.util package.

Both Scala’s Option and Java SE 8’s Optional are used to represent optional values. Both are used to AVOID unwanted null checks and NullPointerException.

Scala’s Option is similar to Java SE 8’s Optional. Java SE 8 has introduced a new utility class Optional to represent existing or non-existing of some value. Optional is available in java.util package.

Both Scala’s Option and Java SE 8’s Optional are used to represent optional values. Both are used to avoid unwanted null checks and NullPointerException.



Discussion

No Comment Found