Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was reviewing some Apex code when I found an expression like this:

if (a <> null && b != null) {

My gut feeling tells me that <> is an alternative way to say "not equals," is this correct? If so, is it different than !=, sort of like how != and !== are similar yet different?

I could not find any references to <> in the following documentation:

share|improve this question
Poll Response: I always use != – Scott Pelak Feb 27 '14 at 22:05
up vote 5 down vote accepted

You're correct that it isn't in the docs. The operators are identical in operation.

<> is from the days of BASIC and != is from the days of C and is used by the languages that followed it. Most modern languages support both.

Wikipedia: Relational Operators

share|improve this answer
Thanks. I know SQL uses <> too and it means the same thing. But I was not sure being a new language (to me). – Snowman Feb 27 '14 at 22:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.