Listing 4: Inheritance.scala 1 class Person ( v a l firstName : String , 2 v a l lastName : String , v a l age : I n t ) { 3 o v e r r i d e def t o S t r i n g = " . . . "+firstName+" . . . " 4 def doSomething = {} // wait . . . what? 5 } 6 7 class Student ( firstName : String , lastName : String , 8 age : I n t ) extends Person ( firstName , lastName , age ) 9 { 10 o v e r r i d e def doSomething = { 11 System . out . p r i n t l n ( " I ’m studying hard . " ) 12 } 13 } Sven Pfleiderer Scala - A Scalable Language