Java tutorial
//package com.java2s; import java.lang.reflect.Constructor; import java.lang.reflect.Method; public class Main { private static Class epdControllerClass; private static Class epdControllerRegionClass; private static Class epdControllerRegionParamsClass; private static Class epdControllerWaveClass; private static Object[] waveEnums; private static Object[] regionEnums; private static boolean successful = false; public static void setDUMode() { System.err.println("Orion::setDUMode"); try { if (successful) { Constructor RegionParamsConstructor = epdControllerRegionParamsClass .getConstructor(new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE, epdControllerWaveClass, Integer.TYPE }); Object localRegionParams = RegionParamsConstructor .newInstance(new Object[] { 0, 0, 600, 800, waveEnums[2], 14 }); Method epdControllerSetRegionMethod = epdControllerClass.getMethod("setRegion", new Class[] { String.class, epdControllerRegionClass, epdControllerRegionParamsClass }); epdControllerSetRegionMethod.invoke(null, new Object[] { "Orion", regionEnums[2], localRegionParams }); } } catch (Exception e) { e.printStackTrace(); } } }