I
Ivan Sofa n.1
hello,
this is my question: why the compiler says:
"exception in thread "main" java.lang.NullPointerException
at Cruciverba.<init>(Cruciverba.java:12) //la riga corriposponde
at MainClass.main(MainClass.java:8)
this is the Class Cruciverba
public class Cruciverba
{
public String parole[];
// costruttore
Cruciverba()
{
parole[1]=new String ("Pallone"); parole[2]=new String ("Ciao");
}
and this is MainClass
public class MainClass
{
public static void main(String[] args)
{
Cruciverba Primo=new Cruciverba();
}
}
it's a run-time error
help me please!!!!
ivan
this is my question: why the compiler says:
"exception in thread "main" java.lang.NullPointerException
at Cruciverba.<init>(Cruciverba.java:12) //la riga corriposponde
at MainClass.main(MainClass.java:8)
this is the Class Cruciverba
public class Cruciverba
{
public String parole[];
// costruttore
Cruciverba()
{
parole[1]=new String ("Pallone"); parole[2]=new String ("Ciao");
}
and this is MainClass
public class MainClass
{
public static void main(String[] args)
{
Cruciverba Primo=new Cruciverba();
}
}
it's a run-time error
help me please!!!!
ivan