X1009: Conditionally Adding to a List

The method below takes in two parameters: a Pixel object called p and a List called list. For this method, if the list has less than 20 items in it, add the pixel to the end of the list. Whether or not the pixel is added, the list passed in as a parameter should then be returned.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.