HOF compilation checks

Report a typo

We have a user class with the ability to regenerate the identifier:

case class User(id: Long, nick: String) {
  def regenerateUserId(regenerate: Long => Long): User = {
    val newId = regenerate(this.id)
    this.copy(id = newId)
  }
}

We wrote a function for regeneration:

def idToNewFormat(id: Int): Int =
  id + 10000

What happens if we pass it as an argument to the regenerateUserId method?

Select one option from the list
___

Create a free account to access the full topic