What am I doing wrong?
package com.codegym.task.task04.task0409;
/*
Closest to 10
*/
public class Solution {
public static void main(String[] args) {
closeToTen(8, 11);
closeToTen(7, 14);
}
public static void closeToTen(int a, int b) {
int a1 = abs(a - 10);
int b1 = b - 10;
if (a1 > b1) {
System.out.println(b);
} else if (a1 < b1) {
System.out.println(a);
} else {
System.out.println(a + " " + b);
}
}
public static int abs(int a) {
if (a < 0) {
return -a;
} else {
return a;
}
}
}