The modifiers
integer is basically a combination of integer flags that form a bit field. You can use the static Modifier.toString()
method to get a textual representation. If you would use this method, it would tell you that 4161
stands for public volatile
, and it would be wrong.
To break it down, the bit field represented by 4161
is composed of 3 integer flags: 1
, 64
and 4096
. Looking up these values in the Modifier
Javadoc, it will tell you that 1
stands for public
and 64
stands for volatile
. Surprising, because methods cannot be declared as volatile
, and what about 4096
? It's not even in the list!
The answer can be found in the JVM specification, where we find that:
4096
(0x1000
) indicates a synthetic method, i.e. a method that is not present in the source code.64
(0x0040
) not only represents thevolatile
access modifier, but can also be used to signify that a method is a bridge method, i.e. a method that is generated by the compiler.
The conclusion is then that a method with a modifiers
value of 4161
is a public
synthetic bridge method. This article provides a fairly comprehensive overview.