I've run it through another compiler with all negatives and it returns the correct maximum value. Any help would be greatly appreciated.
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int num1 = Integer.parseInt(br.readLine());
int num2 = Integer.parseInt(br.readLine());
int num3 = Integer.parseInt(br.readLine());
int num4 = Integer.parseInt(br.readLine());
if (num1 >= num2 && num1 >= num3 && num1 >= num4)
System.out.println(num1);
else if (num2 >= num1 && num2 >= num3 && num2 >= num4)
System.out.println(num2);
else if (num3 >= num1 && num3 >= num2 && num3 >= num4)
System.out.println(num2);
else if (num4 >= num1 && num4 >= num2 && num4 >= num3)
System.out.println(num4);
}
}