What does it mean when you have a variable, such as accessing $002 in Java?

I have a Java jar. I have decompiled the permissions of the original developer and we will use it until they can get a copy of our source code I encountered a member of a class similar to the following:

Classname.access$002(Param1,Param2);

The class name is correct, but accessing $002 doesn't look correct (in addition to accessing $204, other numbers are appended to the end, and there are several others). I wonder if this means anything in Java, or because the decompilation operation is incomplete

I'm decompiling these classes using JD - GUI

It is also worth mentioning that there is no signature method the same as the $002 method, at least in the classname class

Solution

Accessing the $XXX method is a call from an internal non - static class to a member of a nested class

public class DummyDummy {

private int x = 0;
private Inner i = new Inner();
private int foo(int a,int b) {
    return a+b+x;
}

private class Inner {
    void doIt() {
        System.out.println(
         // Here,DummyDummy.access$0(DummyDummy,int,int) is called 
         // which calls DummyDummy.foo(int,int)
             foo(1,2)                 );
    }
}

public static void main(String[] args) {
    new DummyDummy().i.doIt();
}

}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>