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.