I have read other answers to try to find the solution but nothing clearly explains the issue.
Why should the following code block create a null pointer exception for currArraySize?
int biggestArraySize = 0;
int currArraySize = 0;
for(int i = 0 ; i < myMap.keySet().size(); i++){
ArrayList<String> currList = new ArrayList<String>();
currList = myMap.get(i);
currArraySize = currList.size();
if(currArraySize > biggestArraySize){
biggestArraySize = currArraySize;
}
}
System.out.println(biggestArraySize);