Также всё работало с отрицательными числами.
package com.javarush.task.task04.task0419;
/*
Максимум четырех чисел
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String a = reader.readLine();
String b = reader.readLine();
String c = reader.readLine();
String d = reader.readLine();
int a1 = Integer.parseInt(a);
int b1 = Integer.parseInt(b);
int c1 = Integer.parseInt(c);
int d1 = Integer.parseInt(d);
if (a1 >= b1 || c1 >= d1) {
if (a1 >= c1) System.out.println(a1);
else System.out.println(c1);
} else if (a1 <= b1 || c1 <= d1) {
if (b1 >= d1) System.out.println(b1);
else System.out.println(d1);
}
}
}