need help with a java program. this program should be in
java language:
Write a function that when given two integers, x and y,
returns the maximum divisor of x or y, excluding x or y
themselves.
For example, if the two integers are 8 and 9, the divisors of 8
(excluding 8) are 1, 2, and 4 while the divisors of 9 (excluding 9)
are 1 and 3. The maximum is 4.