Function reference with an instance

Report a typo

Given the following class with a few functions:

class Customer(val firstName: String, val lastName: String) {
    fun receiveFirstName():String {
        return firstName
    }

    fun receiveLastName():String {
        return lastName
    }
} 

Here is one instance of the class:

val customer: Customer = Customer("Paul", "Morris")

How can you write a function reference to the function receiveFirstName() using this instance?

Do not add whitespaces to your result.

Enter a short text
___

Create a free account to access the full topic