Scala Vector informational and mathematical methods (syntax, examples)

This page contains a collection of examples of how to use Scala Vector class informational and mathematical methods. Note that these same methods will also work with a Scala Seq, including IndexedSeq.

Informational and mathematical methods

As the name implies, these methods let you get information about the contents of a Vector, or perform mathematical expressions on a Vector.

An introduction to Scala’s collection classes (and methods)

This post is an excerpt from the Scala Cookbook. (This is the introduction to Chapter 10, Collections.)

The Scala collection classes are rich, deep, and differ significantly from the Java collections, all of which makes learning them a bit of a speed bump for developers coming to Scala from Java.