This is my main codes:
Scanner input= new Scanner(System.in);
Student[] starray=new Student[5];
for (int i=0; i<3; i++)
{
System.out.println("enter:");
starray[i].name=input.next();
System.out.println("enter:");
starray[i].family=input.next();
System.out.println("enter:");
starray[i].sid=input.nextInt();
}
for(int i=0; i<3; i++)
System.out.println(starray[i].name);
and i have one class :
String name,family;
Integer sid;
Student(){
name="kh";
family="kh";
sid=0;}
when i run it have Exception below: Exception in thread "main" java.lang.NullPointerException at testcodes.TestCodes.main(TestCodes.java:19) Java Result: 1
new Student()@Chrismas007 I think his question is in the title....