Flash Sale: Flat 70% + Addl. 25% Off on all Courses | Use Coupon DS25 in Checkout | Offer Expires In

  Enroll Now

Scala - Assessment - Declare an array

An array is one of the collections in Scala, which stores a fixed-size sequential collection of elements of the same type.

We will declare an array of strings, named strArray, having below elements in the same order.

Elements of the array:
John
Doe
Jane
Sach

In general, providing the datatype of the variable is optional. So, an array can be defined in either of the below ways:

var ar:Array[String] = Array(.....)

var ar = (.....)

But, the above problem statement specifies that the array will consist of strings only, so :Array[String] is required here.

INSTRUCTIONS
  • Switch to the Jupyter tab.

  • Declare the array of the required name and having required items in the Jupyter.

  • Press Shift+Enter. You should see the output showing the array name and its content.

  • Click on "Submit Answer".


No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...