Need help: convertir un tableau

fredspv Messages postés 127 Date d'inscription dimanche 7 mars 2004 Statut Membre Dernière intervention 6 juin 2008 - 5 avril 2004 à 19:43
cs_GodConan Messages postés 2113 Date d'inscription samedi 8 novembre 2003 Statut Contributeur Dernière intervention 6 octobre 2012 - 5 avril 2004 à 20:00
Bonjour,

J'aimerais convertir le tableau issu de la method: public static void main(String[] args) en un tableau d'entier.

Voici mon ptit code:

int n = args.length;
int test[] = new int[n];
for (int i = 0; i < n; i++) {
test = Integer.parseInt(args[i]);//ça plante ici
}

Merci

1 réponse

cs_GodConan Messages postés 2113 Date d'inscription samedi 8 novembre 2003 Statut Contributeur Dernière intervention 6 octobre 2012 12
5 avril 2004 à 20:00
GodConan :clown)

ben affiche chac argument ;o) tu va voir pourquoi
System.out.println("args[" + i + "] = " + args[ i ] ); ds ta boucle
et puis je pense que si tu ecri test[ i ] = Integer ....
c mieu ;o)

++
0
Rejoignez-nous