2 ms·
The beauty of kotlin is they don't need to. I use kotlin on the backend (never did android development). It's amazing. Better version of java than java. Use an
by syspec 1y ago
The beauty of kotlin is they don't need to.
I use kotlin on the backend (never did android development). It's amazing. Better version of java than java. Use any and all java libraries transparently (there's nothing to change or do), heck you can even have the java and kotlin in the same codebase (something I haven't really done, but tried it for fun)
Java and Kotlin both compile down to .class Java bytecode.
To the JVM, there is no difference
- pjmlp 1y agoReally? How do you call Kotlin co-routines from Java code without wrapper types?
- syspec 1y agoSuspend functions appear as regular JVM methods with an extra Continuation parameter. Tools like runBlocking make them straightforward to call from Java. My main point was that you can use Java code as is without modifications from Kotlin, and that if you wanted you could have Java code in your project and it will work just fine. Of course if you wanna start calling co-routines from the Java part of your project to the Kotlin part, hey that's up to you.