Algorithme
Fermé
maxwell
-
12 févr. 2007 à 15:24
alezan1 Messages postés 10 Date d'inscription lundi 12 février 2007 Statut Membre Dernière intervention 12 février 2007 - 12 févr. 2007 à 16:58
alezan1 Messages postés 10 Date d'inscription lundi 12 février 2007 Statut Membre Dernière intervention 12 février 2007 - 12 févr. 2007 à 16:58
A voir également:
- Algorithme
- Logiciel algorithme euromillion - Télécharger - Loisirs créatifs
- Logiciel algorithme gratuit - Télécharger - Édition & Programmation
- Algorithme qui calcule le carré d'un nombre - Forum Algorithmes / Méthodes
- Code ascii algorithme - Guide
- Algorithme ajout rapide snapchat - Forum Snapchat
1 réponse
alezan1
Messages postés
10
Date d'inscription
lundi 12 février 2007
Statut
Membre
Dernière intervention
12 février 2007
3
12 févr. 2007 à 16:58
12 févr. 2007 à 16:58
Voici un petit exemple en java qui affiche la date plus l'argument
public static void main(String []args) {
// Make sure the command
// line argument was passed in
if(null == args || args.length < 1) {
// Command line argument
// doesn't exist, so exit with
// an error flag
System.exit(1);
}
// Timestamp the message
Date now = new Date();
String message = now.toString();
message += ": ";
// Extract the only command line
// argument from the first element
// of the array
message += args[0];
System.out.println(message);
}
public static void main(String []args) {
// Make sure the command
// line argument was passed in
if(null == args || args.length < 1) {
// Command line argument
// doesn't exist, so exit with
// an error flag
System.exit(1);
}
// Timestamp the message
Date now = new Date();
String message = now.toString();
message += ": ";
// Extract the only command line
// argument from the first element
// of the array
message += args[0];
System.out.println(message);
}