C# 0 The Complete Reference


Gen , then all  Gen



Download 4,07 Mb.
Pdf ko'rish
bet676/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   672   673   674   675   676   677   678   679   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

Gen

, then all 



Gen

 objects will 

use the same executable code. Thus, code-bloat is reduced and only those versions of the 

class that are actually used in the program will be created. When a different constructed 

type is needed, a new version of the class is compiled.

www.freepdf-books.com




544

 

P a r t   I :  



T h e   C #   L a n g u a g e

In general, a new executable version of a generic class is created for each constructed 

type in which the type argument is a value type, such as 

int

 or 


double

. Thus, each object of 



Gen

 will use one version of 



Gen

 and each object of type 



Gen

will use another 

version of 

Gen

, with each version of 



Gen

 tailored to the specific value type. However, there 

will be 

only one version

 of a generic class that handles all cases in which the type argument is a 

reference type. This is because the size (in bytes) of all references is the same. Thus, only one 

version is needed to handle all types of references. This optimization also reduces code-bloat.




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   672   673   674   675   676   677   678   679   ...   1096




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