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.

Create a program named different.java that has two overloaded methods that take

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 Different [Java Application] /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java (Feb 5, 2019, 4:13:22 PM) Exception in thread "main" java. lang.Error: Unresolved compilation problems: The method SameDifferent (int, int, int) in the type Different is not applicable for the arguments (int, int, int, int) The method SameDifferent(int, int, int) in the type Different is not applicable for the arguments (int, int, int, int) The method SameDifferent(int, int, int) in the type Different is not applicable for the arguments (int, int, int, int) at different/different.Different.main(Different.java:10)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!