Question: Consider the following static method public static Point highestPoint (List points) Iterator pointIterator- points.iterator); int highest 0; Point highestPoint = null; // TODO use the

 Consider the following static method public static Point highestPoint (List points)

Consider the following static method public static Point highestPoint (List points) Iterator pointIterator- points.iterator); int highest 0; Point highestPoint = null; // TODO use the iterator to complete this method! return highestPoint; You are required to complete the static method. The static method contains an iterator of an ArrayList of Point objects. You should use a loop and the pointIterator to check the point with the largest Y value. Returns the point with the largest Y value Insert statements in the answer box below For example Test Result List points new LinkedList() java.awt.Point[x-3,y-8] points.add(new Point (1, 1)); points.add (new Point (1, 3)); points.add(new Point (3, 1)); points.add(new Point(3, 8)); System.out.println(highestPoint(points)); Answer (penalty regime: 0 %) 1 public static Point highestPoint(List points) 2 Iterator pointIterator points.iterator(); int highest e; 4 Point highestPointnull; 5// TODO use the iterator to complete this method! 7 8 return highestPoint; 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!