Run the demo.paramargs Command line arguments. try { final Class[] ARG_TYPES = new Class[] { String.class }; Constructor cst = Integer.class.getConstructor(ARG_TYPES); System.out.println(cst.newInstance(new Object[] { "45" })); } catch (final Exception ex) { ex.printStackTrace(); }
try { final Class[] ARG_TYPES = new Class[] { String.class }; Constructor cst = Integer.class.getConstructor(ARG_TYPES); System.out.println(cst.newInstance(new Object[] { "45" })); } catch (final Exception ex) { ex.printStackTrace(); }