I need to make the two methods below return the maximum and minimum of three numbers, but I keep getting an error saying that it cannot find the symbol MaxOf3 in 12 line and MinOf3 in line 15 in the main method above the other two. How do I fix this???
I looked it up on the internet, but I could not find the right solution.
import java.util.Scanner;
public class MaxAndMin {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n1 = in.nextInt();
int n2 = in.nextInt();
int n3 = in.nextInt();
int max = MaxOf3(n1,n2,n3);
System.out.println("Maximum: " + max);
System.out.println("Minimum: " + MinOf3(n1,n2,n3));
}
public static int findMax(int max) {
int maximum = Math.max(8, 9);
int maximum2 = Math.max(maximum, 1);
System.out.println("The maximum of 8, 9, and 1 is " + maximum2);
return maximum2;
}
public static int findMin(int min) {
int minimum = Math.min(8, 9);
int minimum2 = Math.min(minimum, 1);
System.out.println("The minimum of 8, 9 and 1 is " + minimum2);
return minimum2;
}
}