For the code fragment below, Choose the expression that shows the correct output?
object Main extends App { val adder = new Adder(2) System.out.println(adder.apply(4)) } class Adder(x: Int) { var y = 5 def apply(y: Int) = x + y }
Correct Answer: 6
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Scala MCQ Questions