i created array size of 3 each of type arrayList so at this point ar,ar,ar are just variables of type ArrayList are created but are pointing to null . so until unless we redirect this from null to actual Arraylists they will be with null. and accessing a null object produces null pointer exception.
by assiginig where k2 = 0,1,2
we are redirecting the variable to ArrayList object.
I hope i cleared ur doubt.
Joined: Jan 09, 2004
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: getting a Null pointer exception at this point