开发者

What does it mean when you have a variable like access$002 in Java?

I have a java jar I have decompiled with permission of the original developer that we are to use until they can get us a copy of the source code. I have run into a member of a class that looks like the following:

Classname.access$002(Param1, Param2);

Classname is correct, but the access$002 does not look right (there are a few others like this except with the names access$204 and with other numbers appended to the end), and I am wondering if this means anything in Java or if it is because the decompile operation was incomplete.

I am using JD-GUI to decompile the classes.

It i开发者_如何学Gos also worth mentioning that there are no methods with the same signature as the access$002 method does, at least in the class Classname.


The access$XXX methods are calls from inner non-static classes to members of the nesting 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();
}

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜