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)
    }
}
  1. The parameter is of Boolean data type
  2. The parameter is of Integer data type
  3. The parameter is of Character data type
  4. The parameter is of Float data type

Answer: D) The parameter is of Float data type

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.