import java.util.Random; public class MaximumOf4 { public static void main (String[] args) { Random random = new Random (); int first = random.nextInt (); int second = random.nextInt (); int third = random.nextInt (); int forth = random.nextInt (); int maximum = first > second ? first : second; maximum = maximum > third ? maximum : third; maximum = maximum > forth ? maximum : forth; System.out.println ("Random numbers generator were " + first + ", " + second + ", " + third + ", and " + forth + ". The maximum of these four number is " + maximum); } }