Java Topic Practice
Return Values
Return Values MCQ Practice
Question 1 of 15
Answered 0 of 15
Choose one answer.
What is printed by the following code segment?
public class Main {
public static int gap(int x, int y) {
if (x > y) return x - y;
return y - x;
}
public static void main(String[] args) {
System.out.print(gap(18, 5));
}
}