Run the demo.
try {
final Class[] ARG_TYPES = new Class[] { String.class };
Object result = null;
Method meth = Integer.class.getMethod("parseInt", ARG_TYPES);
result = meth.invoke(null, new Object[] { new String("44") });
System.out.println(result);
result = meth.invoke(null, new Object[] { new String("Jonny") });
System.out.println(result);
} catch (final Exception ex) {
ex.printStackTrace();
}