在项目所在target目录找到class文件
将class文件复制到任意java文件目录内,通过idea打开class文件即为反编译后的文件
java文件
package com.xuqp.study.structure;
/**
* @author xuqiuping
* @create 2021-06-16 23:00
* @descripition
*/
public class Demo01 {
public static void main(String[] args) {
String name = "球拍";
switch (name) {
case "卡了":
System.out.println("卡了");
break;
case "球拍":
System.out.println("球拍");
break;
}
}
}
class文件
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.xuqp.study.structure;
public class Demo01 {
public Demo01() {
}
public static void main(String[] args) {
String name = "球拍";
byte var3 = -1;
switch(name.hashCode()) {
case 681797:
if (name.equals("卡了")) {
var3 = 0;
}
break;
case 945962:
if (name.equals("球拍")) {
var3 = 1;
}
}
switch(var3) {
case 0:
System.out.println("卡了");
break;
case 1:
System.out.println("球拍");
}
}
}
原文:https://www.cnblogs.com/xuqpStudy/p/14891576.html