Quick actions

cmd+k|ctrl+k

Navigation

Languages

Interfaces

Snippet info

Language

Kotlin

Visibility

public

Author

habib17

Created

2019-11-03T13:09:20Z

Updated

2019-11-03T15:12:46Z

fun main(args : Array<String>){
    val gagak = Bird(2)
    gagak.fly()
}

interface IFly{
    fun fly()
    val numberOfWings: Int
}

class Bird (override val numberOfWings: Int) : Ifly{
    override fun fly(){
        if(numberOfWings > 0) println("Flying with $numberOfWings wings")
       else println("I flying without wings")
    }
}
INFO