Some strong “building-blocks” of scala (Tutorial 1 : Lists)

Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. Scala supports functional programming & is a pure object-oriented language in the sense that every value is an object. Let us discuss about some of the strongest building blocks of Scala.

Scala Lists:
Lists are an important data structure in many Scala programs. A list containing the elements x1, . . . , xn is written List(x1, …, xn).Lets have an example of List and some operations on it:

Result for the code above would look like:

With these special operations shown in this example, Lists has a lot of other convenient operations for use like below.

Result for the code above would look like:

1 thought on “Some strong “building-blocks” of scala (Tutorial 1 : Lists)

Leave a Reply

%d bloggers like this: