Question 1 of 5
Ribbon has getters getLength and getColor. Write longest so it returns the largest getLength() in ribbons. Assume ribbons is not empty.
public class Ribbon {
private int length;
private String color;
public Ribbon(int length, String color) {
this.length = length;
this.color = color;
}
public int getLength() {
return length;
}
public String getColor() {
return color;
}
}
public int longest(ArrayList<Ribbon> ribbons) {
/* write this method */
}