Over a million developers have joined DZone.

Equals() Method To Compare Values

·
Equals method to compare values


        int price = 100;
        int amount = 1000
        if (price.Equals(amount))
	{
	    Console.WriteLine("Price is equal to amount");
	}
        else
        {
	    Console.WriteLine("Price is not equal to amount");
        }
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}