Si votre email correspond à un compte, vous recevrez un lien de réinitialisation.
BonsoirJ'ai eune erreur lorsque je souhaite invoker une methode ayant unparametre .Ce parametre etant un tableau d'entier .Merci d'avancePhilippepublic void setArgsTab(int[]x1) {System.out.println("Un tableau d'entiers setargsTab"+x1.length);}// CAS ENTIERS TABLEAUObject[] params2b=new Object[] { new Integer[]{ new Integer(1),newtry{Class cl = class1.getClass();Class[] mainsParamTypes = new Class[] { int[].class };Method mainMethod = cl.getDeclaredMethod( "setArgsTab", mainsParamTypes );mainMethod.invoke( class1, params2b );}/*catch( ClassNotFoundException e ){System.out.println( "Cannot find ");}*/catch( NoSuchMethodException e ){System.out.println( "Cannot find main in ");}catch( IllegalAccessException e ){System.out.println( "Cannot invoke main???in ");}catch( InvocationTargetException e ){System.out.println( "main threw anexception" );e.getTargetException( ).printStackTrace( );}
Bonsoir J'ai eune erreur lorsque je souhaite invoker une methode ayant un parametre . Ce parametre etant un tableau d'entier . Merci d'avance Philippe public void setArgsTab(int[]x1) { System.out.println("Un tableau d'entiers setargsTab "+x1.length); } // CAS ENTIERS TABLEAU Object[] params2b=new Object[] { new Integer[] { new Integer(1),new try { Class cl = class1.getClass(); Class[] mainsParamTypes = new Class[] { int [].class }; Method mainMethod = cl.getDeclaredMethod ( "setArgsTab", mainsParamTypes ); mainMethod.invoke( class1, params2b ); } /*catch( ClassNotFoundException e ) { System.out.println( "Cannot find "); }*/ catch( NoSuchMethodException e ) { System.out.println( "Cannot find main in "); } catch( IllegalAccessException e ) { System.out.println( "Cannot invoke main??? in "); } catch( InvocationTargetException e ) { System.out.println( "main threw an exception" ); e.getTargetException( ).printStackTrace( ); }