Initialize the array doing
Rational[] rationals = new Rational[] { new Rational(2, 18), new Rational(4, 5), ... };
(Sorry I couldn't name the array rats lol).
EDIT:
If you're going to load the numbers from a file, you can do something like
Scanner scanner = new Scanner(file);
int currentRational = 0;
while (scanner.hasNext()) {
int num = scanner.nextInt();
int den = scanner.nextInt();
scanner.nextLine();
rationals[currentRational] = new Rational(num, den);
currentRational++;
}
This is assuming your file has this format
10 3
4 5
etc.