Computer Science 252
Problem Solving with Java

Fall 2014, The College of Saint Rose

Lecture 21: ArrayList Practice
Date: Thursday, November 13, 2014


Lecture 21 Assignment

Due at the start of class, Tuesday, November 18.

Please submit answers to these questions in Submission Box under "LA21" or in hard copy by the start of our next class. We will discuss these questions at the start of class, so no late submissions are accepted. Please be sure that your name is clearly indicated in all submissions.

  1. Write a method that takes an ArrayList of objects that implement the Drawable2DInterface as its parameter (the parameter will have type ArrayList<Drawable2DInterface>) and returns the number of the objects in the array whose x-coordinates are less than 200. (5 points)
  2. Write a method that takes an int and an ArrayList of Integer as parameters and returns another ArrayList of Integer that includes only those values from the original ArrayList that are greater than the int parameter's value. (5 points)