Online Java Compiler By
JavaTpoint.com
//import statements import java.lang.reflect.Method; public class ReflectMethodisBridgeExample2 { public static void main(String[] args) { String nm = "java.util.Date"; try { Class cls = Class.forName(nm); printMethods(cls); } catch (ClassNotFoundException e) { System.out.println("Class not found."); } } public static void printMethods(Class cls1) { Method[] mthd1 = cls1.getDeclaredMethods(); for (int i = 0; i < mthd1.length; i++) { Method m = mthd1[i]; System.out.println(m.getName()+ " = " + m.isBridge()); } } }
Output