arraylist is not printing first element : <p>I am trying to write some java code, but I am getting an Exception. 
my problem is that I am getting a null pointer exception when I try to add athlete
the program is to accept athletes and the calculate score average
Here is my code</p>

<pre><code>public class AthleteTest {

        final int  MAX_ATHELETE = 200;
        private int count=0;    
        Athlete[] at = new Athlete[MAX_ATHELETE];
        Scanner sc = new Scanner(System.in);

    public void addAthletes(){
            char add = 'Y';
            while(add == 'Y'){

                System.out.println("name:");
                String name = sc.nextLine();
                at[count].setName(name);

                //Get athlete's Id number
                System.out.println("id :");
                int id = sc.nextInt();
                at.setId(id);

                //sc.nextLine();

                count++;


                System.out.println("Would you like to add another athlete?   Y / N");
                add = Character.toUpperCase(sc.next().charAt(0));
                sc.nextLine();
            }
        }
    }


    my Athlete class is as follow

    public class Athlete {

        private String name;
        private int id;

        private double [] grades;

        public Athlete(){
            this.name = null;
            this.id= 0;
        }

        public Student(String name, int id){
            this.name = name;
            this.id= id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }
    }
</code></pre>
