Question: JAVA The Comparator class has several methods for comparing numbers. In the starter code below, implement each method according to its Javadoc public class Comparator
JAVA
The Comparator class has several methods for comparing numbers. In the starter code below, implement each method according to its Javadoc

public class Comparator { /** * Empty-argument constructor */ private Comparator() { }//end constructor * This method accepts two integers, determines which * is the larger of the two and returns it. * @param X - integer greater than * @param y - integer greater than @return largest integer (need to bound check either integer) */ public static int largestNumber(int x, int y) { }//end largest Number * This method determines if x is a multiple of y * @param x larger number * @param y - smaller number * @return true or false (you do not need to bounds check, assume greater than zero) */ public static boolean isMultiple(int x, int y) { }//end isMultiple /** This method determines if both inputs are divisible * by 10. * * @param x - integer greater than or equal to 10 * @param y - integer greater than or equal to 10 @return - true if and y are both divisible by 10, false otherwise (and if either of the numbers are less than 10) */ public static boolean bothDivisibleTen(int x, int y) { }//end bothDivisibleTen /** * This method determines if a number is odd. * @param x - integer greater than zero. * @return - true if number is odd, false otherwise (you do not need to bounds check) */ public static boolean isOddNumber(int x) { }//isOddNumber }//end class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
