Determine if two value are equal with the == operator. Notice the 2 = characters.
public static boolean compare(int val1, int val2) {
boolean result = val1 == val2;
return result;
}
Function Call | Return Value | |||
---|---|---|---|---|
compare(6, 6) | → | |||
compare(12, 12) | → | |||
compare(8, 7) | → | |||
compare(12, 24) | → | |||
compare(7, 7) | → |
Experiment with this code on Gitpod.io