I am working on a little project and have big problem.... I faced the bad side of NullPointerException in Java So here is the code:
  Coordinates[] point = new Coordinates[26];
    for (int i = 0; i < points.length; i++) {
        if (points[i] > 0) {
            char ch = (char) (i + 65);
                point[i].setName(ch);
                point[i].setX(points[i]);
        }
    }
    //Coordinates is class containing 3 fields
    //setName() method just sets Name field
    //setX() method sets X coordinate
I want to make point for every letter in alphabet, but I got NullpointerException when I use setName() method.How can I fix it, please help :(
 
     
    