← Unit 2 · all exercises
Saved in this browser only

Are they equal

Return true when the two numbers are the same. Remember that comparing uses two equals signs, not one.

boolean isSame(int a, int b)

Solution.java
Loading editor…
Results

Examples

  • isSame(7, 7) → true
  • isSame(7, 8) → false

There are also 3 hidden tests you can't see. Solve the problem, not the examples.