Click here to Skip to main content
15,917,610 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Please tell what is the difference between == and ===

Regards,
Kalesh
Posted
Updated 27-Mar-10 22:16pm
v4

C# Operators[^] from MSDN, as you can see there is no reference to "===" so maybe you could show the piece of code that has this in it.
 
Share this answer
 
the only circumstance I've ever seen (and used) === was in PHP.
google PHP comparison operators if that is what you need.

:)
 
Share this answer
 
I've common across ?? but never across ===.
AFAIK, this does not exist.
 
Share this answer
 
There are several answers to this.

0) The difference is the extra "=" sign. Which one is considered "extra" is up to the observer.

1) The first one ("==") is a valid C# operator, and the 2nd one ("===") is not.

2) You got the tag for this question wrong and intended to specify PHP. That's the only language I've ever seen with the "===" syntax.

"a$ == b$"  TRUE if $a is equal to $b.
"a$ === b$"  TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)

By the way, answer #2 in the list above was easily found with google.
 
Share this answer
 
v2
Did you tried to use it ;P ?
If yes, did you succeeded in it, if yes then let us also know how and if you failed then probably there is nothing like it :laugh: .
 
Share this answer
 
= = is a comparison operator in C#

but === is a comparison operator in JSP and it stands for is exactly equal to

example of comparison operator == in C# is as follows

C#
using System;
namespace Comparison_operator
{
    class Program
    {
        static void Main(string[] args)
        {
            string name = Console.ReadLine();
            if (name == "radix")
            {
                Console.WriteLine("Hello");
            }
            else
            {
                Console.WriteLine("Unknown user");
            }

        }
    }
}


do rate my answers once u find it useful
Thanks & Regards
Radix :rose:
 
Share this answer
 
=== check type and equalty in php
 
Share this answer
 
Do you mean "What is the difference between '=' and '==' operators"?
If so, then '=' is an assignment; it makes a variable hold a new value.
For example:
int i = 7;
int j = i * 2;


While '==' is a comparison operator; it evaluates two values, and responds with true if they are the same, or false is they are different:
int i = 7;
if (i == 6)
   {
   thrown new ElementaryMathmaticsNotWorkingException("Seven is the same as six");
   }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900