Modifier.isPrivate(int mod) has the following syntax.
public static boolean isPrivate(int mod)
In the following code shows how to use Modifier.isPrivate(int mod) method.
import java.lang.reflect.Modifier; /* w ww.j a v a 2 s. c o m*/ public class Main { public static void main(String[] args) throws Exception { Class<?> clazz = String.class; int modifier = clazz.getModifiers(); if (Modifier.isPrivate(modifier)) { System.out.println("isPrivate"); } } }