I’m getting this java. lang. NullPointerException when ever I try to call a function from the class array I created.
For example:
A[] arr = new A[10]
//Error occurs when I execute this line below
arr[0].methodName()
Can anyone tell me why am I getting this error?