but I can't solve the task and I have no idea why? can please help me
package com.codegym.task.task04.task0409;
/*
Closest to 10
*/
public class Solution {
public static void main(String[] args) {
displayClosestToTen(8, 11);
displayClosestToTen(7, 14);
}
public static void displayClosestToTen(int a, int b) {
// write your code here
int g = abs(10 - a);
int h =abs(10 - b);
if (g < h)
System.out.println(a);
else if (h<g)
System.out.println(b);
else
System.out.println(a+b);
}
public static int abs(int a) {
if (a < 0) {
return -a;
} else {
return a;
}
}
}