The method below is designed to return the smaller of two Co…

The method below is designed to return the smaller of two Comparable objects received as arguments. Assume that the objects are instances of the same class. Select the correct expression to complete the method. public static Comparable smaller(Comparable value1, Comparable value2) { if (_________________________ ) return value1; else return value2); }

Consider the following class: public class BowlingGame impl…

Consider the following class: public class BowlingGame implements Comparable { private int score; // other methods go here public int compareTo(Object otherObject) { BowlingGame otherGame = (BowlingGame) otherObject; __________________________________; } } What statement can be used to complete the compareTo() method?

Select an appropriate expression to complete the following m…

Select an appropriate expression to complete the following method, which is designed to visit the elements in theList and replace each occurrence of the string “hello” with the string “goodbye”. public static void helloGoodbye(LinkedList theList) { ListIterator iterator = theList.listIterator(); while (iterator.hasNext()) { if (iterator.next().equals(“hello”)) { _____________________________ } } }