Home »
MCQs »
Scala MCQs
Correct syntax for creating an array in Scala –
94. Correct syntax for creating an array in Scala -
- var array_name : Array[data_type] = new Array[data_type(size)
- var array_name: Array[data_tpye] = new Array(size)
- var array_name = Array(element1, elmenet2, element3, ...)
- All of these
Answer: D) All of these
Explanation:
Read more: How to print an array in Scala?