Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

The snippet that has to be used to check if “a” is not equal to “null” is _________

a) if(a!=null)
b) if(a!null)
c) if (!a)
d) if(a!==null)

Answer: d
Explanation: A strict comparison (e.g., ===) is only true if the operands are of the same type and the contents match. The more commonly-used abstract comparison (e.g. ==) converts the operands to the same type before making the comparison. The not-equal operator !== compares 0 to null and evaluates to either true or false.

Join The Discussion