用IDEA查看反编译

好久不见. 提交于 2020-08-09 16:30:50

目录

一 找到java编译后的class文件

二 查看编译后的结果

三 将字节码文件拷贝到IDEA中

四 打开这个class文件


一 找到java编译后的class文件

二 查看编译后的结果

发现是乱码

三 将字节码文件拷贝到IDEA中

四 打开这个class文件

下面这个结果就是IDEA反编译的结果

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


public class Employee {
    String name;
    int age;
    String designation;
    double salary;


    public Employee(String name, int age, String designation, double salary) {
        this.name = name;
        this.age = age;
        this.designation = designation;
        this.salary = salary;
    }


    public Employee() {
    }


    public String getName() {
        return this.name;
    }


    public void setName(String name) {
        this.name = name;
    }


    public int getAge() {
        return this.age;
    }


    public void setAge(int age) {
        this.age = age;
    }


    public String getDesignation() {
        return this.designation;
    }


    public void setDesignation(String designation) {
        this.designation = designation;
    }


    public double getSalary() {
        return this.salary;
    }


    public void setSalary(double salary) {
        this.salary = salary;
    }


    public void printEmployee() {
        System.out.println("Name:" + this.name);
        System.out.println("Age:" + this.age);
        System.out.println("Designation:" + this.designation);
        System.out.println("Salary:" + this.salary);
    }


    public String toString() {
        return "Employee{name='" + this.name + '\'' + ", age=" + this.age + ", designation='" + this.designation + '\'' + ", salary=" + this.salary + '}';
    }
}

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!