2019-11-07 16:01:16 +03:00
|
|
|
## Data Classes (#2)
|
2019-07-15 17:01:04 +03:00
|
|
|
|
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
|
|
|
|
```
|