Skip to main content

Comparison

The integer data type supports comparison using the == format. However, other data types, such as String, should be compared using the .equals() or .compareTo() functions.

Common mistakes:

context.value == "foo" will not work.

context.value.equals("foo") could lead to NullPointerException. However, "foo".equals(context.value) will result in false in case the value is null.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!