Self Reference Type in Scala

The keyword this refers to the object instance on which the currently executing method was invoked, or if used in a constructor, the object instance being constructed. It has the following syntax:

def lessThan(that: Rational) =
this.numer * that.denom < that.numer * this.denom

Here, [java]this.numer[/java] refers to the numerator of the object on which less than was invoked. You can also leave off this prefix and write just [java]numer;[/java] the two notations are equivalent.