08th
Jun
Scala MCQ

Scala MCQ

  • Admin
  • 08th Jun, 2022
  • 398 Followers

Take Scala MCQ Quiz & Online Test to Test your Knowledge

We have listed below the few Scala MCQ Questions that check your basic knowledge of Scala. This Scala MCQ Test contains 20+ Multiple Choice Questions. You have to select the right answer to the question. Apart from this, you can also download here Scala MCQ PDF, completely free.

Scala MCQ

1) What is Scala?

  • A. Programming language
  • B.Framework
  • C.Platform
  • D.None of the above

2) Scala is a programming language invented by _____.

  • A. Mr. Martin Odersky
  • B.James Gosling
  • C.Dennis Richie
  • D.None of the above

3) What is the advantage of Scala?

  • A. Less error prone functional style
  • B.High maintainability and productivity
  • C.High scalability
  • D.All of these

4) What are the Scala variables?

  • A. var myVar : Int=0;
  • B.val myVal: Int=1;
  • C.Both A and B
  • D.None of the above

5) Which one of the following Programming languages uses both object-oriented programming and functional programming paradigms?

  • A. Scala
  • B.Machine language
  • C.Pascal
  • D.Ada
Download Free : Scala MCQ PDF

6) Scala stands for “____.”

  • A. Scalable language
  • B.Sequential language
  • C.Script language
  • D.Scalar language

7) What are the few collections in Scala?

  • A. Array
  • B.List
  • C.Sets
  • D.All of these

8) Which of the following are the IDEs(Integrated Development Environments) for Scala?

  • A. IntelliJ IDEA
  • B.VS Code
  • C.GNU Emacs
  • D.All of the above

9) The ___ is a representation of a map of all published Scala libraries.

  • A. Scala Library Index
  • B.Scaladex
  • C.Scala Document
  • D.Both A and B

10) Is Scala is Case Sensitive language?

  • A. Yes
  • B.No

11) Which of the following are true regarding While loop?

  • A. Repeats a statement or group of statements while a given condition is true.
  • B.It tests the condition before executing the loop body.
  • C.Both A and B
  • D.None of the above

12) The variable defined using __ keywords are mutable and can be changed any number of times.

  • A. var
  • B.val
  • C.var_name
  • D.None of the above

13) Which one of the following keyword use to define a function in Scala?

  • A. def
  • B.func
  • C.function
  • D.We use the data type instead

14) Select the output for the following line of code: println(40.getClass)

  • A. This causes a compilation error
  • B.This causes a runtime error
  • C.int
  • D.40

15) Select the correct statements from the following:

  • A. Unit is like void in Java
  • B.() is an empty tuple that represents a Unit
  • C.Both A and B
  • D.None of the following

16) Which of the following is not used to create a string in Scala?

  • A. var greeting = "Hello world!";
  • B.var greeting:String = "Hello world!";
  • C.Both A and B
  • D.None of the above

17) In Scala, ___ method returns the number of characters contained in the string object.

  • A. length()
  • B.lengths()
  • C.range()
  • D.None of the above

18) The __ interpolator is similar to __ interpolator except that it performs no escaping of literals within a string.

  • A. ‘raw’, ‘s’
  • B.‘s’, ‘raw’
  • C.Both A and B
  • D.None of the above

19) Which one of the following is not a method defined by java.lang.String class?

  • A. String concat(String str)
  • B.boolean contentEquals(StringBuffer sb)
  • C.byte getBytes()
  • D.All of the above

20) What term is used to specify a precondition?

  • A. require
  • B.assert
  • C.Precondition
  • D.None of the above

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Jun
C# MCQ
01st
May
MS Excel MCQ
01st
Feb
NLP MCQ
01st
Jun
JSP MCQ
01st
Mar
CCNA MCQ