Meanings of dollar sign in Java method descriptor?

后端 未结 1 1664
旧时难觅i
旧时难觅i 2020-12-09 20:55

For example, its part of the Jikes RVM stack.

at [0x70cfba90, 0x708cfaa4] Lorg/apache/lucene/index/SegmentInfos; 
       **access$000**(Ljava/lang/String;)V         


        
1条回答
  •  失恋的感觉
    2020-12-09 20:59

    Quoted from the article linked by @birryree:

    A private member m of a class C may be used by another class D, if one class encloses the other, or if they are enclosed by a common class. Since the virtual machine does not know about this sort of grouping, the compiler creates a local protocol of access methods in C to allow D to read, write, or call the member m. These methods have names of the form access$0, access$1, etc. They are never public. Access methods are unique in that they may be added to enclosing classes, not just inner classes.

    0 讨论(0)
提交回复
热议问题