I have a kotlin method as follows:
fun methodWithCallBackAsParameter(callback:() -> Unit) {
//Do Somejob
callback()
}
In kotlin we simply use this method with following syntax:
methodWithCallBackAsParameter {
//Some Instructions here.
}
Now I want to use this Kotlin method in a Java class but I am not able to figure out how.
Just return Unit.INSTANCE in the end of the lambda expression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With