<@U0D06TWMA> Okey, what would you suggest as a goo...
# codereview
b
@Andreas Sinz Okey, what would you suggest as a good workaround since I do work in a mixed java-kotlin project and have a lot of interfaces in java that I have to implement in kotlin, and this problem occurs from time to time.
a
bob: you could override the method as always and use a private val behind the scene
Copy code
fun main(args: Array<String>) {
 	val bar = Bar()
    
    println(bar.getId())    
}

interface Foo {
    fun getId(): Int
}

class Bar : Foo {
    override fun getId(): Int {
        return id
    }
    
    private val id: Int = 5
}
b
Okey, so thats the recommended solution. It’s a bit verbose to be kotlin 😉