This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy


■ U N D E R S TA N D I N G   I N H E R I TA N C E  A N D   P O LY M O R P H I S M 216



Download 21,46 Mb.
Pdf ko'rish
bet442/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   438   439   440   441   442   443   444   445   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

U N D E R S TA N D I N G   I N H E R I TA N C E  A N D   P O LY M O R P H I S M



216

8849CH06.qxd  10/1/07  10:35 AM  Page 216




Although we are not going to place our Person into a System.Collections.Hashtable, for com-

pletion, let’s override GetHashCode(). There are many algorithms that can be used to create a hash

code, some fancy, others not so fancy. Most of the time, you are able to generate a hash code value

by leveraging the System.String’s GetHashCode() implementation.

Given that the String class already has a solid hash code algorithm that is using the character

data of the String to compute a hash value, if you can identify a piece of field data on your class that

should be unique for all instances (such as the Social Security number), simply call GetHashCode()

on that point of field data. If this is not the case, but you have overridden ToString(), call

GetHashCode() on your own string representation:


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   438   439   440   441   442   443   444   445   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish