What am I doing wrong?
<p>I'm just trying to make a simple "phone book" app but I'm doing something wrong. but idk what.</p>

<p>This is my first class,</p>

<pre><code>    import java.util.Scanner;
    public class PhoneBookEntryDemo
    {
    public static void main(String[] args){
        int k=0,contacts=0;
        String position;
        Scanner KB = new Scanner(System.in);

        System.out.println("This is a automatic phonebook. the first of its kind.");
        System.out.println("How many contacts do you want to enter today?"); 
        contacts = KB.nextInt();
        PhoneBookEntry[] Test = new PhoneBookEntry[contacts];
        do{
                switch (k) {     //this is for formatting the out put
                case 0: position="st";
                        break;
                case 1: position="nd";
                        break;
                case 2: position="rd";
                        break;
                default: position="th";
                        break;
            }
            System.out.println("Please enter the name "+ (k+1)+position+" of the contact: ");
            Test[k].getName(KB.next()); //sets the name of what ever the counter is @
            System.out.println("Now enter the phone number: ");
            Test[k].getPhoneNumber(KB.nextInt()); //sets the phone number at whatever the counter is @
            k++;
        }while(k&lt;contacts);
        }
    }
</code></pre>

<p>This is my second class,</p>

<pre><code>    public class PhoneBookEntry
    {
        String name;
        int phoneNumber;
        public PhoneBookEntry(String aName, int aPhoneNumber){
            name = aName;
            phoneNumber = aPhoneNumber;
        }
        public void getName(String setName){
            name = setName;
        }
        public void getPhoneNumber(int setPhoneNumber){
            phoneNumber = setPhoneNumber;
        }

    }
</code></pre>

<p>It complies but it throws a run time error. </p>

<pre><code>java.lang.NullPointerException at PhoneBookEntryDemo.main(PhoneBookEntryDemo.java:31)
</code></pre>

<p>I know its my method calls but I can't figure out what I'm doing wrong I've tried several different iterations but still no dice.</p>
