}
private static void main_A(String[] args) {
- if (args.length == 0) {
- System.out.println("Please run with java Main <class name to inspect>");
- System.exit(-1);
+ String className = null;
+ Scanner uInput = null;
+ try {
+ uInput = new Scanner(System.in);
+ System.out.println("Saisir le nom de la classe à inspecter:");
+ className = uInput.nextLine();
+ }
+ catch (Exception e) {
+ System.out.println("Erreur:");
+ e.printStackTrace();
+ }
+ finally {
+ uInput.close();
}
- String className = args[0];
Class cl = null;
try {
}
}
- /**
- * The main() function
- * @param String[] args main() function arguments array
- */
- public static void main(String[] args) {
+ private static void main_B(String[] args) {
String name = Entiers.class.getName();
Class cl = null;
Entiers o = null;
try {
uInput = new Scanner(System.in);
System.out.println("Saisir le nom de la methode à invoquer:");
- String method = uInput.next();
+ String method = uInput.nextLine();
//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();
uInput.close();
}
}
+
+ /**
+ * The main() function
+ * @param String[] args main() function arguments array
+ */
+ public static void main(String[] args) {
+ main_A(args);
+ }
}