Skip to content

JVM Flags

hydrophobis edited this page Mar 25, 2025 · 8 revisions

Generic flags

  • ACC_PUBLIC: The class or member is public, making it accessible from any other class.

  • ACC_PRIVATE: The class or member is private, restricting access to the defining class only.

  • ACC_STATIC: The class or member is static, meaning it belongs to the class itself, not to an instance.

  • ACC_FINAL: The class or member is final, meaning it cannot be subclassed or overridden.

Function/field flags

  • ACC_SYNCHRONIZED: The method is synchronized, meaning it can only be executed by one thread at a time.

  • ACC_NATIVE: The method is native, meaning its implementation is in another language, typically C or C++, and will be linked at runtime.

  • ACC_PROTECTED: The class or member is protected, making it accessible within its own package and by subclasses.

Class flags

  • ACC_INTERFACE: The class is an interface, meaning it cannot have instance methods but can contain abstract methods to be implemented by other classes.

  • ACC_SUPER: The class has a superclass. Used with ACC_PUBLIC for classes that inherit from a parent class.

  • ACC_ABSTRACT: The class or method is abstract, meaning the class cannot be instantiated or the method must be implemented by subclasses.

Setting more than one modifier:

ACC_PUBLIC | ACC_SUPER // Public class with a super class
ACC_PRIVATE | ACC_STATIC | ACC_FINAL // Private static final field

Clone this wiki locally