nusmanov
nusmanov

Reputation: 491

Short Interface implementation in kotlin

Now

in kotlin we have a possibility to implement the interface like this:

interface AnimalStrategy {
fun eat(): Outcome
}

Want to have

Question: Is it possible to declare the interface in kotlin in shorter syntax?

interface AnimalStrategy = fun eat(): Outcome

Upvotes: 0

Views: 78

Answers (0)

Related Questions