Using Reflection, we can get all the methods of a class. Review the following code:

Java Code:
Class c = Class.forName("Countries");
Method mArray[] = c.getDeclaredMethods();
for(Method m: mArray)
System.out.println(m.getName());
Array of type Method named myArray hold all the methods.