Here's the code I have and it is giving a very stupid error! any idea why?
public class Main {
public Main() {
allStudents = new Stu[1];
allStudents[0].Name1 = "re"; //The NullPointerException occurs here
}
Stu[] allStudents;
public static void main(String[] args) {
new Main();
}
class Stu
{
String Name1;
String Address1;
String Nationality1;
String DOB1;
String Sex1;
int TelephoneNo;
int ID_nos;
int MobileNo;
int MarksEnglish;
int MarksMaths;
int MarksComputers;
}
}
2007-03-06
15:15:03
·
4 answers
·
asked by
HellBoy
2
in
Computers & Internet
➔ Programming & Design