Skip to content

Scala

Scala: scala.util.Try

The type scala.util.Try is an operation that may result in either an exception or a valid output. Let’s explore a few of its usages, including single and chained calls to scala.util.Try.

The Try operation will result in either a Success or Failure. To simplify, think about it an Either for successes and failures instead of Left and Right, but proper for encapsulating exceptions instead of other arbitrary values.

Read More »Scala: scala.util.Try

Scala: access modifiers

Scala access modifiers

Scala provides a more granular access control if compared to Java. This post describes and shows how to implement each of the Scala access modifiers.

Access modifiers

Scala has only two explicit access modifiers: private and protected, besides the implicit no modifier that defaults to public access.

However, we can qualify these modifiers to give them a finer-grained access control level.

Read More »Scala: access modifiers