Today, I suddenly want to study what some kotlin files look like when converted to Java, so that it is convenient to optimize the kotlin code. After a long time, I found a very simple Android Studio or Intellij idea official plug-in Kotlin. Kotlin is the name of the plug-in. I am really drunk;
Here AS is taken as an example, the use is very simple:
1. Find the desired converted kotlin file in the left directory column, select it, and then top Tools ----->Kotlin ------>Show Kotlin Bytecode (there is obviously a Decompile to Java below, which is gray, use Sorry), as shown in the figure:
2. After the previous steps, will the kotlin file be converted into bytecode, as shown in the figure:
3. Click Decompile in the upper left corner of the plug-in window, and it will be decompiled into a Java file, as shown in the figure:
Since this class StringUtils does not declare the keyword open, it is a eunuch class, and it is final after decompilation.
Well, it's time to have fun.