Skip to content

Commit ad5c8e6

Browse files
committed
Adding caution in method-based-if-statement approach
1 parent 3663467 commit ad5c8e6

File tree

1 file changed

+5
-0
lines changed
  • exercises/practice/bob/.approaches/method-based-if-statements

1 file changed

+5
-0
lines changed

exercises/practice/bob/.approaches/method-based-if-statements/content.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ This approach simplifies the main method `hey` by breaking down each response co
4949

5050
The `input` is trimmed using the `String` [`trim()`][trim] method to remove any leading or trailing whitespace. This helps to accurately detect if the input is empty and should prompt a `"Fine. Be that way!"` response.
5151

52+
~~~~exercism/caution
53+
Note that a `null` `string` would be different from a `String` of all whitespace.
54+
A `null` `String` would throw a `NullPointerException` if `trim()` were applied to it.
55+
~~~~
56+
5257
### Delegating to Helper Methods
5358

5459
Each condition is evaluated using the following helper methods:

0 commit comments

Comments
 (0)