Yes, you can. The getModifiers() method returns an int that applied the correct mask, can tell you whether the method is native or not
I would suggest doing it like this: for convenience:
int modifiers = myMethod.getModifiers(); boolean isNative = Modifier.isNative(modifiers);
The Modifier class is a specialized utility class designed to use appropriate masks to detect method modifiers.
Razvan Aug 08 2018-12-12T00: 00Z
source share