卸载JDK

1.删除java的安装目录
2.清除变量设置里的JAVA_HOME
3.清除path与java相关的信息
4.试试java -version判断是否是否删除干净。

IDE

1.psvm自动生成主函数语句
2.sout快捷键自动生成输出语句
3.ctrl+alt+L能够做自动排版工作
4.Ctrl + D 复制当前行到下一行

intellij java 反编译

打开intellijproject struck选项,找到字节码文件的位置,将相应的文件拖到存放对应class文件的地方,再用intellij打开其文件,IDEA会自动反编译文件出来。

原文件

package struct;

public class switchDemo {
    public static void main(String[] args) {
        String name = "kok-s0s";
        //JDK7的新特性,表达式结果可以是字符串!!!
        //字符的本质是数字

        //反编译   java---class(字节码文件)---反编译(IDEA)
        switch (name) {
            case "kok-s0s":
                System.out.println("ok!");
                break;
            case "who":
                System.out.println("who are you?");
                break;
            default:
                System.out.println("what are you going to do?");
        }
    }
}

反编译结果

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package struct;

public class switchDemo {
    public switchDemo() {
    }

    public static void main(String[] args) {
        String name = "kok-s0s";
        byte var3 = -1;
        switch(name.hashCode()) {
        case -543248720:
            if (name.equals("kok-s0s")) {
                var3 = 0;
            }
            break;
        case 117694:
            if (name.equals("who")) {
                var3 = 1;
            }
        }

        switch(var3) {
        case 0:
            System.out.println("ok!");
            break;
        case 1:
            System.out.println("who are you?");
            break;
        default:
            System.out.println("what are you going to do?");
        }

    }
}
Last modification:March 9, 2021
兴趣使然