I need help fixing my telephone keypad application, it will compile but when I run it, it doesnt work someone please help

I need help fixing my telephone keypad application, it will compile but when I run it, it doesnt work someone please help

it throws ArrayIndexOutofBound exception.. reason is that your Button array size is 12
--------------------------------
keys = new Button[12];
----------------------------------
while you are trying to add element at 13th position
keys[12] = new Button("#"); this will throw exception
change to ==> keys = new Button[13];
it will work

it throws ArrayIndexOutofBound exception.. reason is that your Button array size is 12
--------------------------------
keys = new Button[12];
----------------------------------
while you are trying to add element at 13th position
keys[12] = new Button("#"); this will throw exception
change to ==> keys = new Button[13];
it will work

So it should be keys[12] = new Button("#");

So it should be keys[12] = new Button("#");

it worked but now when I run it i get java.lang.NullPointerException