I'm just stuck on error "Exception in thread "main" java.lang.NullPointerException" Please tell me the mistake I'm committing, with solution. its a simple array. How i can access the method setAge(int) from this array.
Person arr[] = new Person[2];
arr[0].setAge(20);
Thanks.