This commit is contained in:
Emmanuel Srivastava
2025-01-27 20:32:32 +01:00
parent d582a5055b
commit 4071ce2277
24 changed files with 568 additions and 4 deletions

View File

@@ -0,0 +1,30 @@
public class Arguments {
public static void main(String[] args) {
if (args.length > 0) {
System.out.println("Bonjour, " + args[0] + " !");
if (args.length > 1) {
System.out.println("Bonjour, " + args[1] + " !");
}
if (args.length > 2) {
System.out.println("Bonjour, " + args[2] + " !");
}
} else {
System.out.println("Aucun nom n'a été fourni !");
}
}
}
/*
public class Arguments {
public static void main (String[] args) {
for (String nom ': args) {
System.out.println("Bonjour, " + nom + " !");
}
}
}
AVEC UNE BOUCLE for
*/