# 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.