MCQs > IT & Programming > Scala > Choose the correct statement which shows the output?

Scala MCQs

For the code below, Choose the correct statement which shows the output?

var l1 = scala.collection.mutable.MutableList[String]() val l2 = List[String]() for (a <- 1 to 100) { l1 += a.toString } println(l1 .size); for (a <- 1 to 100) { l2 :+ a.toString } println(l2 .size);

Answer

Correct Answer: 100 then 0

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it