my program is as below and i m getting NullPointerException . how to create an array for object.
import java.io.*;
import java.util.*;
import java.lang.*;
class AccessPoint
{
public void display()throws IOException
{
int x=388,y=560;
System.out.println("accesspoint is located at ("+x+","+y+")");
}
}
class Ex
{
public static void main(
String args[]) throws IOException
{
AccessPoint ap[] = new AccessPoint[5];
for(int j=0;j<5;j++)
ap[j].display();
}
}