1
1
Fork 0
AtomicKotlinCourse/Usability/Data Classes/Exercise 2/task.md

12 lines
305 B
Markdown
Raw Normal View History

2019-11-07 16:01:16 +03:00
## Data Classes (#2)
2020-05-12 19:08:29 +03:00
Create an extension function called `transferTicket()` that copies an
`AirlineTicket` object, replacing `firstName` and `lastName` with the new
values during the copy:
2019-11-07 15:34:33 +03:00
2020-05-12 19:08:29 +03:00
```kotlin
2019-11-07 16:01:16 +03:00
fun AirlineTicket.transferTicket(
2019-11-13 20:32:55 +03:00
otherFirstName: String,
2019-11-07 16:01:16 +03:00
otherLastName: String
): AirlineTicket
```