+ Scanner uInput = null;
+ try {
+ uInput = new Scanner(System.in);
+ System.out.println("Saisir le nom de la methode à invoquer:");
+ String method = uInput.next();
+ //TODO: one can build the input list from the method arguments list and types
+ System.out.println("Saisir l'argument entier paramètre de la méthode:");
+ int integer = uInput.nextInt();
+ Method m = cl.getMethod(method, new Class[]{Integer.class});
+ m.invoke(o, integer);
+ }
+ catch (Exception e) {
+ System.out.println("Erreur:");
+ e.printStackTrace();
+ }
+ finally {
+ try {
+ Method mDisplay = cl.getMethod("afficher");
+ mDisplay.invoke(o);
+ }
+ catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ uInput.close();
+ }