Home > MCQs > IT & Programming > Scala MCQs

Scala MCQ

Scala Quick Quiz

Question 1 of 10
  • Why would you make a field private?

    Answer & Explanation

    Correct Answer: So only methods in the same class could access the field

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

  • What is the defaut parameter call semantics?

    Answer & Explanation

    Correct Answer: By Value

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

  • Scala is:

    Answer & Explanation

    Correct Answer: An object-functional language that supports functional programming constructs

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

  • What do you call objects with immutable state?

    Answer & Explanation

    Correct Answer: Functional objects

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

  • Scala's "Unit" roughly corresponds to which Java type?

    Answer & Explanation

    Correct Answer: "void"

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

  • Which term makes the contents of packages available without prefixing?

    Answer & Explanation

    Correct Answer: Import

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

  • Which statement about if-else-if-else statements is true?

    Answer & Explanation

    Correct Answer: If an else-if succeeds, then none of the remaining else-if statements or elses will tested.

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

  • What is denotes the intersection between two sets?

    Answer & Explanation

    Correct Answer: &

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

  • Which statement about case classes is false?

    Answer & Explanation

    Correct Answer: Case classes as sealed and therefor cannot be extended

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

  • What would be returned by the following function: def foo(l:List[Int]) = { var x=l.head; l.collect{ case a:Int if a>x => x=a; a }; x } When passed: List(2,4,6,8,6,3,1)

    Answer & Explanation

    Correct Answer: 8

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

  • Scala Quick Quiz

    battery

    Poor Results!

    You need a lot of improvement.

    Just don't give up!

    Correct Answers: 0/10

    Start Practicing with our MCQs given below.