Name

Modifier

Synopsis

This class defines a number of constants and static methods that can interpret the integer values returned by the getModifiers( ) methods of the Field, Method, and Constructor classes. The isPublic( ) , isAbstract( ), and related methods return true if the modifier value includes the specified modifier; otherwise, they return false. The constants defined by this class specify the various bit flags used in the modifiers value. You can use these constants to test for modifiers if you want to perform your own boolean algebra.

public class Modifier {
// Public Constructors
     public Modifier( );  
// Public Constants
     public static final int ABSTRACT;     =1024
     public static final int FINAL;        =16
     public static final int INTERFACE;    =512
     public static final int NATIVE;       =256
     public static final int PRIVATE;      =2
     public static final int PROTECTED;    =4
     public static final int PUBLIC;       =1
     public static final int STATIC;       =8
                  1.2  public static final int STRICT;   =2048
     public static final int SYNCHRONIZED; =32
     public static final int TRANSIENT;    =128
     public static final int VOLATILE;     =64
                  // Public Class Methods
     public static boolean isAbstract(int mod);  
     public static boolean isFinal(int mod);  
     public static boolean isInterface(int mod);  
     public static boolean isNative(int mod);  
     public static boolean isPrivate(int mod);  
     public static boolean isProtected(int mod);  
     public static boolean isPublic(int mod);  
     public static boolean isStatic(int mod);  
1.2  public static boolean isStrict ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.