daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Car (var miles: Int, val buildingYear: Int)
  2.  
  3. val c = new Car(0, 2007)
  4.  
  5. println(c.miles) //getter
  6. println(c.year) //getter
  7.  
  8. c.miles = 200 //drive 200 miles
  9.  
  10. //not possible because val is final
  11. //c.year = 2012
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top