Home »
MCQs »
Scala MCQs
The output of the following block of code is | Scala Question 10
75. The output of the following block of code is -
object MyClass {
def datatype(x:Int){
println("The parameter is of Integer datatype")
}
def datatype(x:Float){
println("The parameter is of Float data type")
}
def datatype(x:Char){
println("The parameter is of Character data type")
}
def datatype(x: Boolean){
println("The parameter is of Boolean data type")
}
def main(args: Array[String]) {
datatype(4.0f)
}
}
- The parameter is of Boolean data type
- The parameter is of Integer data type
- The parameter is of Character data type
- The parameter is of Float data type
Answer: D) The parameter is of Float data type