How should we end a stream to calculate sum of elements?
1.Sink.sum_
2.Sink.fold[Int, Int](0)(_ + _)
3. Sink.sum[Int](_
4.Sink.map(_ + _)
Is Scala is Case Sensitive language?
1.Yes
2.No
3.Maybe
4.Can't say
Java compatibility makes Scala suitable for _______
1.Apple Development
2.Android Development
3.Google Development
4.None of the above
Left and Right are case classes.
1.Yes
2.No
3.May be
4.Can't say
One of the following is an erroneous function definition, can you spot it
1.def functionName(x:Int,y:Int):Int=x+ywrong
2.def functionName(x:Int,y:Int):Int={return x+y}
3.Sets
4.All of these
What is Scala?
1.Programming language
2.Framework
3.Platform
4.None of the above
_______ is a Scala compiler that compiles to JavaScript.
1.Scala.js B.
2.Scala.py
3.Scala.tktcorrect
4.Scala.cppwrong
10. Now a days Scala's Java compatibility makes well suited for
1.Microsoft developmentwrong
2.Google development
3.Android developmentcorrect
4.Apple development
A list is a collection which contains ___ data.
1.immutable
2.mutable
3.both (a) and (b)
4.None of the above
How can you format a string?
1.Val formatted= “%s %iâ€.format (mystring.myInt)
2.Val formatted= “%s %iâ€.formatted (mystring.myInt)
3.Val formatted= “%s %iâ€.formatstring(mystring.myInt)
4.Val formatted= “%s %iâ€.formatstrings(mystring.myInt)
How do we implement loops functionally?
1.Loop Constructs
2.Mutability
3.Side Effects
4.All of the these
How do you abruptly stop execution in the REPL?
1.Pressing Ctrl+C
2.Pressing Ctrl+X
3.Pressing Ctrl+Z
4.Pressing Ctrl+V
In Scala, apply() serves the purpose of closing the gap between Object-Oriented and Functional paradigms
1.True
2.False
3.both (a) and (b)
4.Error
It is not required to pass these __________ parameters to a method while calling it. D.
1.Command-line arguments
2.Default parameters
3.Implicit parameters
4.Named arguments
Omitting a semicolon(;) at the end of a statement causes the compiler to throw an error.
1.Yes
2.No
3.May be
4.Can't say
One of the following is an erroneous function definition, can you spot it
1.def functionName(x:Int,y:Int):Int=x+ywrong
2.def functionName(x:Int,y:Int):Int={return x+y}
3.def functionName(x:Int,y:Int):Int{x+y} ()
4.def functionName(x:Int,y:Int)={x+y
Programming language which uses both object-oriented programming and functional programming paradigms is
1.Scala
2.Ada
3.Pascal
4.Machine language
Scala is a short form of
1.Scalable language
2.Sequential language
3.Script language
4.Scalar language
Scala is designed by _______.
1.Guido van Rossum
2.John Von Neumann
3.Martin Odersky
4.None of the above
Scala is short form of
1.Scalable language
2.Sequential language
3.Script language
4.Scalar language
Scala is written in ________ language
1.C
2.Java
3.Python
4.C++
Scala runs on the _____ platform.
1. C
2.C++
3.JavaScript
4.Java
Scala stands for “____.â€
1.Scalable language
2.Sequential language
3.Script language
4.Scalar language
Scala stands for ________.
1.Scalable language
2.Script language
3.Scalar language
4.Sequential language
Scala was released in the year ______.
1.2002
2.2004
3.2003
4.2005
Select the Scala construct that holds pairwise different elements of the same type
1. Groups
2.Sets
3.Maps
4.Forums
The advantage of Scala are __________.
1.High scalability
2.High maintainability and productivity
3.Less error-prone functional style
4.All of the above
The null value is of type _______
1.scl.Null
2.scala.n
3.scala.Null
4.None of the above
The ___ is a representation of a map of all published Scala libraries.
1.Scala Library Index
2.Scaladex
3.Scala Document
4.Both A and B
The ___ method is utilized to select an element in the list by its index.
1.apply()
2.unapply()
3.Both A and B
4.All of the above
This optimizer is based on functional programming construct in A. Java B. Scala C. D. R
1.Java
2.Scala
3.Python
4.R
We can execute a Scala program in ______ modes.
1. interactive mode
2.script mode
3.both (a) and (b)
4.None of the above
What are the different types of Scala literals?
1.Character Literalswrong
2.String Literals
3.Multi-Line strings
4.All of the above mentioned
What are the few collections in Scala?
1.Array
2.Sets
3.List
4.All of the above
What are the few collections in Scala?
1.Array
2.List
3.Sets
4.All of the above
What are the Scala variables?
1.val myVal: Int=1
2.var myVar : Int=0;
3.both (a) and (b)
4.None of the above
What are the Scala variables?
1.var myVar : Int=0;
2. val myVal: Int=1;
3.both (a) and (b)
4.None of the above
What are the types of scala identifiers?
1.Alphanumeric identifiers
2.Operator identifiers
3.Mixed identifiers
4.All of these
What are the utility methods used in Scala?
1.String utility methods
2.Implicit conversion methods
3.Assertion utility methods
4.All of the above
What are three main part of akka streams?
1.Source, Flow, Sink
2.Source, Flow, BidirectionalFlow
3.ReactiveStream, Source, Flow
4.Stream, Source, Reactive
What is a monad in Scala?
1.An object that wraps another
2.A singleton object
3.A function with a single parameter
4.None of the above
What is Scala used for?
1.functional programming
2.strong static systems
3.both (a) and (b)
4.None of these
What is Scala?
1.API
2.UI development tool
3.framework
4.programming language
What is Scala’s programming paradigm?
1.Statically-Typed
2.Functional
3.Object-Oriented
4.All of these
What is the advantage of Scala?
1.Less error prone functional style
2.High maintainability and productivity
3.High scalability
4.All of the above
What is the advantage of Scala?
1.High testability
2.Provides features of concurrent programming
3.High scalability
4.All of these
What is the three main part of Akka streams?
1.Source, Flow, Sink
2.Source, Flow, BidirectionalFlow
3.ReactiveStream, Source, Flow
4.Stream, Source, Reactive
When can you use traits?
1.If the behaviour will not be reused, then make it a concrete class. Anyhow it is not a reusable behaviour
2. In order to inherit from it in Java code, an abstract class can be used
3. If efficiency is a priority then lean towards using a class
4.All of the above
Which among the following is a Scala Web Frameworks?
1.The Lift Framework
2.The Bowler framework
3.The Play framework
4.All of the above
Which among the following is a Scala Web Frameworks?
1.The Play framework
2.The Lift Framework
3.The Bowler framework
4.All of the above
Which companies use Scala?
1.LinkedIn
2.Twitter
3.Tumblr
4.All of the above
Which of the following are the IDEs(Integrated Development Environments) for Scala?
1.IntelliJ IDEA
2.VS Code
3.GNU Emacs
4.All of the above
Which of the following not shows how to declare variables of the basic numeric types?
1.val b: Byte = 1 B.
2.val s: Short = 1
3.val f: Float = 3.0
4.None of the above
Which of the following technology is good for Stream technology?
1.Apache Spark
2.Apache Hadoop
3.Apache Flinkcorrect
4.None of the above
Which one of the following is a feature of Scala strings?
1. It can be changed.
2.It is a mutable object.
3.It allows creating multiline strings by including the string inside three double quotes.
4.All of the above
Which one of the following is not a method defined by java.lang.String class?
1.boolean contentEquals(StringBuffer sb)
2.String concat(String str)
3.byte getBytes()
4.All of the above
Which one of the following Programming languages uses both object-oriented programming and functional programming paradigms?
1.Scala
2.Machine language
3.Pascal
4.Ada
Without an explicit import, maps in Scala are by default _______
1.Mutable
2.Immutable
3.both (a) and (b)
4.None of the above
Without an explicit import, maps in Scala are by default:
1.Immutable
2.Mutable
3.None
4.None of the above
____ abstraction from functional programming helps us deal with updating complex immutable nested objects.
1.Case classes
2.Lens
3.Extractors
4.None of the above
____ is a Scala compiler that compiles to JavaScript.
1.Scala.py
2.Scala.js
3.Scala.tkt
4.None of the above
_____ is used to define a function in Scala
1.function
2. def
3.func
4.All of the above