Java tutorial
import java.lang.reflect.Modifier; public class Main { public static void main(String[] argv) throws Exception { int mods = String.class.getDeclaredMethods()[0].getModifiers(); if (Modifier.isPublic(mods)) { System.out.println("member is public"); } } }