access_flags - raphaelxia的专栏 - CSDNBlog

来源:互联网 发布:网络代理什么意思 编辑:程序博客网 时间:2024/04/23 16:03

对于接口文件

public interface  interfaceName{

}

 

access_flags=ACC_PUBLIC|ACC_ABSTRACT|ACC_INTERFACE

ACC_PUBLIC=0x0000 0001

ACC_ABSTRACT=0x0000 0400

ACC_INTERFACE=0x0000 0200

access_flags=0x0000  0601

 

注意与 interface interfaceName{

}

是有区别的。

access_flags=ACC_ABSTRACT|ACC_INTERFACE=0x0000 0400 | 0x0000 0200=0x0000 0600

 

对类文件:

public class className{

}

一般情况下:

this_flags=ACC_PUBLIC |  ACC_SUPER =0x0000 00010 | x0000 0020 =0x0000 0021=32

 

 

public final class className{}

this_flags=ACC_PUBLIC|ACC_FINAL|ACC_SUPER=0x0000 0001 | 0x0000 0010 | 0x0000 0020

                =0x0000 0031=49 

ClassFile表内的access_flags项的标志位:

ACC_PUBLIC=       0x0000 0001                       类或者接口

ACC_FINAL=          0x0000  0010                      类(不能派生)

ACC_SUPER=       0x0000 0020                       类

ACC_INTERFACE= 0x0000 0200                      接口

ACC_ABSTRACT=  0x0000 0400                接口或者方法(抽象方法)

原创粉丝点击