I don't think there is any way other than looping and checking each element for null.
The only other supposedly "Easy" way could have been by checking out the size but that wont work because if we add null to an arraylist it increments its size.
Code Example :- In the below mentioned code we add null twice to the arrayList aList and it prints out its size as '2'.
Here is a method for finding if the arraylist is null
This is exactly what we discourage. Look at the heading for the Beginners' Forum and you read this:
Prashant Hurria wrote:Since this is posted in the beginner forum i will go in bit of a detail (Code Examples etc.)
By giving a simple answer like that, you are preventing jeevan stanzilous from learning Java. Please don't post answers like that.
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.