Remember how we briefly discussed classes in the previous lesson? We mentioned that classes are used to create objects and also specify which operations the object can use (built-in methods). The great thing about Scala arrays is that they can use all the operations of the sequence class. Let’s use some of those operations to populate an array.
In the example below, we will populate another array with a few selective elements from the intArray in the previous example.