I've got a class called Info and it's method load contains this piece code:
Circuito[] circuito=new Circuito[19];
for(int i=0;i<circuito.length;i++)
circuito[i] = new Circuito(nome,immPath,sfondoPath,previsioni,giri,tempoGiro,carico);
I pass correctly all the parameters (I printed the toString() method to check if it works).
Then, in another class called New I have this code:
Info info=new Info();
info.load();
System.out.println(info.getCircuito()[0].toString());
(The class Info contains the method getCircuito to returns the entire array).
then, I receive this error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at New.<init>(New.java:21)
the line 21 is the System.out.print line.
I don't understand which is the problem...Thank you for your help!
getCircuito()method also.