← Unit 1 · all exercises
Saved in this browser only

Are they the same word

Return true when the two words are exactly the same, including capital letters. Strings are compared with .equals, not with == — that is the point of this one.

boolean same(String a, String b)

Solution.java
Loading editor…
Results

Examples

  • same(java, java) → true
  • same(java, Java) → falsecapitals matter

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