I want to know if an Object in an ArrayList is null. If it's null, then it shouldn't do anything. Example:
if(!(theList.get(theIndexofObject) == null)){
do something...
}
else{
do nothing...
}
This doesn't work, because it throws an exception cause of the '.get()'-method. Any ideas to solve this problem?
ArrayList#get()asks for an int (the object index), not an object.