// test for rock
List rocks = getWorld().getObjectsAt(x , y, Rock.class);
/* Look up the List class (java.util.List) in the Java API
* and determine what method to use with the 'rocks' List
* to determine if there was a rock. Put the correct test
* in the 'if()' statement below.
*/
if () {
return true;
}
return false;
Have to fill in the "if()" statement above return true; Really confused how to get the if statement with lst. Please help! and send knowledge of how to do! Thank you so much guys!
If I understand correctly, what you want is to check if a concrete object Rock is on the list 'rocks'. Then you just have to use the method "contains". public boolean List.contains(Object o) checks if the object 'o' exists on the list.