Question: Java Question: Complete the following for loop to print out the names of all the Player objects (stored in an arraylist) who are more than
Java Question:
Complete the following for loop to print out the names of all the Player objects (stored in an arraylist) who are more than 30 years old. Assume that the Player class is already defined elsewhere, and has a display() method in it, along with all the usual get/set methods. Each Player object has 2 attributes : a name and an age. Also assume there is a variable named players, which is an ArrayList of Player objects, and this variable has been initialised elsewhere. You may declare any other variables in your code as needed.
for (___________________________________________)
{
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
