cs_merioma
Messages postés17Date d'inscriptionlundi 3 mars 2008StatutMembreDernière intervention17 avril 2009
-
18 juin 2008 à 00:29
Twinuts
Messages postés5375Date d'inscriptiondimanche 4 mai 2003StatutModérateurDernière intervention14 juin 2023
-
18 juin 2008 à 10:46
salut ;
j'ai pas pu corrigé cet exception:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
voilà le code:
public class InsertProcess {
public void InsertProc(String nom, float deg, int occ){
}
public static void main(String[]args ){
System.out.println(args.length);
String nom=args[0] ;
Float deg=Float.parseFloat(args[1]) ;
int occ=Integer.parseInt(args[2]) ;
InsertProcess insertp= new InsertProcess();
insertp.InsertProc(nom,deg,occ);
}
}
Liverion
Messages postés296Date d'inscriptionmardi 22 avril 2008StatutMembreDernière intervention18 août 2008 18 juin 2008 à 09:33
Il faudrait que tu mettes if(args.length >= 3) avant de faire tes assignations pour etre sûr qu'il y a bien des paramètres en entrée ;)
~~
Les trois lois de Codes-Sources :
Loi 1) Tu lis et respectes le reglement
Loi 2) Tu penses à valider si une reponse apportée à ton problème t'a aidé
Loi 3) Si tu ne respectes pas les 2 premières ....TU SORS !!