Question: programs output public class ItemChoice { public static T chooseItem(T item1, T item2, T item3) { T chosenItem = item1; if (item2.compareTo(chosenItem) < 0) {
programs output
public class ItemChoice {
public static
if (item2.compareTo(chosenItem) < 0) { chosenItem = item2; } if (item3.compareTo(chosenItem) < 0) { chosenItem = item3; } return chosenItem; }
public static void main(String[] args) { Integer i1 = 8; Integer i2 = 3; Integer i3 = 9;
System.out.println(chooseItem(i1, i2, i3)); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
