import java.lang.reflect.*; public class SinPi { public static void main(String[] args) { try { Class math = Class.forName("java.lang.Math"); Class[] params = new Class[1]; params[0] = Double.TYPE; Method sin = math.getMethod("sin", params); Object[] arg_list = new Object[1]; arg_list[0] = new Double(3.141529); Double d = (Double) sin.invoke(null, arg_list); System.out.println("The sine of Pi is " + d); } catch (Exception e) { System.err.println(e); } } }