class Car(val year : Int, var miles : Int) {
  def drive(dist : Int) = miles += dist
}

//Constructor created plus Scala style (simple) getters and setters (only getter for year) 

val car = new Car(2011, 0)

println(car.year)

println(car.miles)

car drive 10
println(car.miles)