Guest User

Untitled

a guest
May 28th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. class Student(val id: Int?,
  2. val name: String?,
  3. val age: Age?)
  4.  
  5. class Age(var day: Int?,
  6. var month: Int?,
  7. var year: Int?)
  8.  
  9.  
  10. class ProblemChild {
  11. fun begin() {
  12. val age = Age(1, 11, 2012)
  13. val student = Student(21, "Nick", age)
  14. System.out.println(student.age)
  15. age.month = age.year
  16. age.day = 12
  17. student.age!!.year = 1000
  18. System.out.println(student.age)
  19. }
  20. }
Add Comment
Please, Sign In to add comment