C#

Equality in C# (==, Equals)

Në shqip: Barazia në C#

ShpjegimiSQ

Për klasat, == kontrollon nëse janë i njëjti objekt; për string-ët dhe record-et krahason vlerën. Për t'i krahasuar klasat e tua sipas vlerës, mbishkruaj Equals() dhe GetHashCode() — ose thjesht përdor record.

EnglishEN

For classes, == checks whether they're the same object; for strings and records it compares the value. To compare your own classes by value, override Equals() and GetHashCode() — or just use a record.

Si ta mendosh

Si dy bileta për të njëjtin vend: dy copa letre, por vlejnë njësoj.

Lexoje në anglisht

Like two tickets for the same seat: two pieces of paper, same value.

Terma të lidhur