Home / CSE MCQs / Scala-1 :: Discussion

Discussion :: Scala-1

  1. One of the following is an erroneous function definition, can you spot it
  2. A.
    def functionName(x:Int,y:Int):Int=x+y
    B.
    def functionName(x:Int,y:Int):Int={return x+y}
    C.
    def functionName(x:Int,y:Int):Int{x+y} ()
    D.
    def functionName(x:Int,y:Int)={x+y}

    View Answer

    Workspace

    Answer : Option D

    Explanation :



Be The First To Comment