Modifier.isVolatile(int mod) has the following syntax.
public static boolean isVolatile(int mod)
In the following code shows how to use Modifier.isVolatile(int mod) method.
import java.lang.reflect.Modifier; //from w w w . j a v a2 s . co m 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"); } } }