repositories
/
Project_POO.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe98f4b
)
exo3: trap the empty class name case properly.
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Tue, 3 Apr 2018 18:35:13 +0000
(20:35 +0200)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Tue, 3 Apr 2018 18:35:13 +0000
(20:35 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
exo3/Main.java
patch
|
blob
|
blame
|
history
diff --git
a/exo3/Main.java
b/exo3/Main.java
index f15a4ec26d6e428ff3022eb4b74b7cf9ff3b33f5..4909568f8527f54341b7ea5963925373310971b3 100644
(file)
--- a/
exo3/Main.java
+++ b/
exo3/Main.java
@@
-41,7
+41,12
@@
class Main {
* @param String[] args main() function arguments array
*/
public static void main(String[] args) {
+ if (args.length == 0) {
+ System.out.println("Please run with java Main <Class Name to inspect>");
+ System.exit(-1);
+ }
String className = args[0];
+
Class cl = null;
try {
cl = Class.forName(className);