🧪 Scala framework MCQ Quiz Hub

Scala Multiple-Choice Questions Set 1

Choose a topic to test your knowledge and improve your Scala framework skills

1. Scala programming language was developed by -




2. What is the paradigm of the Scala programming language?




3. Scala stands for ___.




4. Which of the following is not a feature of Scala?




5. Is Java required before installing Scala on the system?




6. The semicolon (;) in Scala is -




7. The Scala compiler starts executing from -




8. Which of the following are not present in Scala?




9. The correct syntax for creating Single line comments in Scala is,




10. The correct output of the following code is, object MyClass { def main(args: Array[String]) { var i,j=0 for(i <- 0 to 3){ for(j <- 0 until 2){ if(i + j == 3){ print((i*j)+" ") } } } } }




11. Which of these is not a primary data type in Scala -




12. The size of integer data type in Scala is -




13. Why is Double better than Float values?




14. Which class is the super-class of all classes in Scala?




15. Which type class does not inherit AnyVar?




16. The correct output of the below code block is - object MyClass { def main(args: Array[String]) { var a : Float = 454.32138988f var b : Double = a; printf("a = " + a + " b = " + b) } }




17. Default values of string type when it is not initialized -




18. Which type in Scala is a subtype of all types -




19. Statement returned by function when no values are returned in Scala - None of these




20. In Scala, can you return two values?




21. What is the range defined by the below statement - range(13, 17, 2)




22. Which is not a Scala method for printing text on the screen?




23. What is the output of following code? val i = 43 i = 231 printf(i)




24. Literals in Scala are ___.




25. Based on Type Casting, which of these conversions is lossy or invalid?




26. Which type of typecasting is done by the compiler?




27. Explicit Conversion is -




28. The getClass() method is used to -




29. Converting Character to Integer will return




30. Which Scala keyword is used to initialize a variable?




31. Lazy initialization is -




32. The total number of keywords in Scala are -




33. Which of these is not a keyword in Scala?




34. Using a keyword as a value will lead to -




35. Is 'sealed' a keyword in Scala -




36. Identifiers in Scala are names given to -




37. Which of these is not a type of identifier -




38. Is the following identifier valid? 12Scala_3




39. Literal Identifier is -




40. The correct output of the following code is - object myObject { def main(args: Array[String]) { var _value1 = 54 var 3value_2 = 65 println("The sum of two values is " + (_value1 + value_2)) } }




41. Which variable in Scala can save memory while declaring variables?




42. How many types of operators are present in Scala?




43. Logical operators in Scala are used to -




44. What is the use of the "&=" operator in Scala -




45. Find the result of the following code block - (3 + 4 * 5) >>> 1




46. Relation operators are -




47. What is the symbolic operator in Scala?




48. The final keyword in Scala is used to -




49. A final method can be applied on?




50. What is the scope of a local variable in Scala?