Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (2.6k points)

I have a Kotlin source file, but I want to translate it to Java.

How can I convert Kotlin to Java source?

1 Answer

0 votes
by (46k points)

Android Studio, you just have to do the following to get java code from kotlin:

  1. Menu > Tools > Kotlin > Show Kotlin Bytecode
  2. Click on the Decompile button
  3. Copy the java code

Update:

With a recent version (1.2+) of the Kotlin plugin you also can directly do Menu > Tools > Kotlin -> Decompile Kotlin to Java.

Related questions

0 votes
1 answer
asked Dec 4, 2019 in Java by Shlok Pandey (41.4k points)
0 votes
1 answer
asked Mar 27, 2020 in Java by Praveen_1998 (119k points)
0 votes
1 answer
asked Dec 4, 2019 in Java by Shlok Pandey (41.4k points)
0 votes
1 answer
0 votes
1 answer
asked Dec 4, 2019 in Java by Shlok Pandey (41.4k points)

Browse Categories

...