первый раз пробую применить метод в решении такого рода задачи.. но не пойму, где ошибка
package com.javarush.task.task04.task0418;
import java.util.Scanner;
/*
Минимум двух чисел
*/
public class Solution {
public static void main(String[] args) throws Exception
{
//напишите тут ваш код
Scanner first = new Scanner(System.in);
int a = first.nextInt();
Scanner second = new Scanner(System.in);
int b = second.nextInt();
Scanner third = new Scanner(System.in);
int c = third.nextInt();
Scanner fourth = new Scanner(System.in);
int d = fourth.nextInt();
if ( maxf(a,b) < maxf(b,c) )
System.out.println(maxf(a,b));
else
System.out.println(maxf(d,c));
public static int maxf(int x, int y)
{
int max;
if (x < y)
max = y;
else
max = x;
return max;
}
}
}