Java Modifier.isVolatile(int mod)

Syntax

Modifier.isVolatile(int mod) has the following syntax.

public static boolean isVolatile(int mod)

Example

In the following code shows how to use Modifier.isVolatile(int mod) method.


import java.lang.reflect.Modifier;
/*  w  ww.  ja  v  a 2 s  . c om*/
public class Main {
  public static void main(String[] args) throws Exception {
    Class<?> clazz = String.class;
    int modifier = clazz.getModifiers();

    if (Modifier.isVolatile(modifier)) {
      System.out.println("isVolatile");
    }
  }
}




















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable