princesseconfitureaicha
Messages postés13Date d'inscriptionsamedi 23 février 2008StatutMembreDernière intervention 7 juin 2009
-
13 déc. 2008 à 23:21
uhrand
Messages postés491Date d'inscriptionsamedi 20 mai 2006StatutMembreDernière intervention15 juillet 2012
-
14 déc. 2008 à 11:20
Bonjour,
voilà je tiens a vous demandez de m'aider sinon se programme va me rendre fou :s SVP c urgent
dans cette methode elle me donne une erreur de type
Exception in thread "main" java.lang.NullPointerException
at Commande.ajouterCmd(Commande.java:14)
at Appli.main(Appli.java:13)
public void ajouterCmd(Article artc, int qte) {
liste[N++] = new ListeCouple(artc, qte);
}
class main
public class Appli {
public static void main(String[] args) {
Stylo S=new Stylo("Sty1", "Stylo bic",1.5,"Stylo bonne qualité","bleu");
Ramette m=new Ramette("Rm1","Ramette HC", 250,"Ramette de papier bonne Qualité",60);
System.out.println(S);
System.out.println(m);
Lots l=new Lots("Lo1",S,10,10);
Lots l1=new Lots("Lo2",m,3,10);
System.out.println(l);
System.out.println(l1);
Commande cmd=new Commande("sara");
cmd.ajouterCmd(l1, 24);//la ligne d erreur avec la suite
cmd.ajouterCmd(l, 30);
cmd.ajouterCmd(S, 24);
cmd.ajouterCmd(m, 30);
System.out.println(cmd);