Look at this example:
class Point(x: Double, y: Double){ override def toString = \"x: \" + x + \", y: \" + y def +(sourcePoint: Point) : Point = { re
using val is valid but then the parameter becomes final (constant). If you want to be able to reassign the value you should use var instead. So
val
var
class Point(var x: Int, var y: Int)