My java bank program is throwing a nut point exception and i can't figure out why : <p>the exception 
    Exception in thread "main" java.lang.NullPointerException
        at HW3.Bank.createNewCustomer(Bank.java:28)
        at HW3.Bank.main(Bank.java:56)"
is on the line 
    MyCustomers[NumofCustomers].openAccount(MyFirstName, MyLastName, openingBalence);" </p>

<p>and the line
    "MyBank.createNewCustomer();"</p>

<pre><code>package HW3;
public class Customer {
private String FirstName;
private String LastName;
private Account MyAccount;

public void openAccount(String MyFirstname, String MyLastname, float OpeningBalence)

{
    MyAccount = new Account();
    if(MyAccount == null);
    {
        FirstName = MyFirstname;
        LastName= MyLastname;
        MyAccount.setMinimumBalence(100);
        MyAccount.setOverdraftFee(45);
        MyAccount.depositFunds(OpeningBalence);
    }
}

public void closeAccount()
{
    MyAccount = null;

}
public void depositFunds(float Funds)
{
    MyAccount.depositFunds(Funds);
}

public void withdrawFunds(float Funds)
{
    MyAccount.withdrawFunds(Funds);
}
public float getBalence()
{
    return MyAccount.getBalence();

}
public void printAccountInfo()
{
    MyAccount.printAccountInfo();
}
public String getFirstName()
{
    return FirstName;
}
public String getLastName()
{
    return LastName;
}
public String getAccountNumber()
{
    return MyAccount.getAccountNumber();
}
}package HW3;

public class Account {

private String AccountNumber;
private float Balence;
private float minimumBalence;
private float overdraftFee;

public float getBalence()
{
    return Balence;
}

public void depositFunds(float Funds)
{
    Balence += Funds;
}
public void withdrawFunds(float Funds)
{
    Balence -= Funds;

    if (Balence&lt;minimumBalence)
    {
            Balence -= overdraftFee;
    }
}   
public void printAccountInfo()
{
    System.out.println("Account number: " + AccountNumber);
    System.out.println("Account Balence: " + Balence);
    System.out.println("Minnimum ballence: " + minimumBalence);
    System.out.println("Account Over draft fee: " + overdraftFee);
}
public String getAccountNumber()
{
    return AccountNumber;
}
public void setMinimumBalence(float MinBalence)
{
    minimumBalence = MinBalence;
}
public void setOverdraftFee(float OverDraft)
{
    overdraftFee = OverDraft;
}

}


package HW3;
import java.util.Scanner;



public class Bank {
    private String RoutingNumber;
    private int NumofCustomers;
    private Customer[] MyCustomers;

public Bank()
{
    this.MyCustomers = new Customer[100];
    NumofCustomers = 0;
}
public void createNewCustomer()
{
    String MyFirstName;
    String MyLastName;
    float openingBalence;
    Scanner userInputScanner = new Scanner(System.in);
    System.out.println("What is your first name? ");
    MyFirstName = userInputScanner.nextLine();
    System.out.println("What is your last name? ");
    MyLastName = userInputScanner.nextLine();
    System.out.println("What is your opening balence? ");
    openingBalence = userInputScanner.nextFloat();
    MyCustomers[NumofCustomers].openAccount(MyFirstName, MyLastName, openingBalence);
}
public int FindCustomer(String MyFirstName, String MyLastName)
{
    for(int i = 0; i&lt; NumofCustomers; i++)
    {
        if((MyCustomers[i].getFirstName() == MyFirstName) &amp;&amp; (MyCustomers[i].getLastName()== MyLastName))
        {
            return i;
        }
    }
    return -1;
}
public int FindCustomer(String AccountNum)
{
    for(int i = 0; i&lt; NumofCustomers; i++)
    {
        if(MyCustomers[i].getAccountNumber() == AccountNum)
        {
            return i;
        }
    }
    return -1;
}

public static void main(String args[]) // main function that initiates the helpers
{
    Bank MyBank = new Bank();
    MyBank.createNewCustomer();
    int index = MyBank.FindCustomer("Bijan", "Azodi" );
    if(index &gt;= 0)
    {
        MyBank.MyCustomers[index].depositFunds(1000);
        MyBank.MyCustomers[index].printAccountInfo();
        MyBank.MyCustomers[index].withdrawFunds(500);
        MyBank.MyCustomers[index].withdrawFunds(601);
    }
    else 
    {
        System.out.print("The customer was not found in this bank");
    }
}
}
</code></pre>
