DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Equals() Method To Compare Values

03.27.2012
| 2205 views |
  • submit to reddit
        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");
        }