Question: Create a program named different.java that has two overloaded methods that take 3 and 4 integer parameters. - If all the integer parameters are the
Create a program named different.java that has two overloaded methods that take 3 and 4 integer parameters.
- If all the integer parameters are the same, the method returns "same".
- If all the integers are different, it returns "different".
- Otherwise, if at least half the integers are the same, it returns "similar".
Test your methods with this main program:
public static void main (String[] args)
{
System.out.println("3,1,5 = " + SameDifferent(3,1,5)); System.out.println("2,0,2 = " + SameDifferent(2,0,2));
System.out.println("5,5,5 = " + SameDifferent(5,5,5));
System.out.println("8,9,2,4 = " + SameDifferent(8,9,2,4));
System.out.println("7,7,1,7 = " + SameDifferent(7,7,1,7));
System.out.println("4,4,4,4 = " + SameDifferent(4,4,4,4)); }
I have started it but I'm not sure how to finish it.

DRecurse,java module-info.jaDifferent,java 3 1 package different; 2 3 public class Different 4 5e public static void main(String[] args) System.out.println("3,1,5- "+ SameDifferent (3,1,5)); System.out.println("2,0,2" SameDifferent (2,0,2)); System.out.println("5,5,5SameDifferent(5,5,5)) System.out.println ("8,9,2,4" SameDifferent (8,9,2,4)); System.out.println("7,7,1,7-" + SameDifferent(7,7,1,7)); System.out.println("4,4,4,4" SameDifferent(4,4,4,4)); 10 Call 312 13 14e 15 static String SameDifferent (int A, int B, int C) return "same" 18 19 20 21 return "different"; return"; 23 24 25 Console X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
