getting null pointer exception?

前端 未结 5 1401
别那么骄傲
别那么骄傲 2020-12-22 11:11

I am trying to have name of contacts in one array and their types in another array,but can\'t get through with null pointer exception.here is my code.I have pointed out the

5条回答
  •  别那么骄傲
    2020-12-22 11:26

    You're not initializing your String[] name, so when you try to access it, you get a null pointer exception. I would suggest using more meaningful variable names. 'name' is very ambiguous.

提交回复
热议问题