C# 0 The Complete Reference


+ . When two objects of type  ThreeD



Download 4,07 Mb.
Pdf ko'rish
bet295/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   291   292   293   294   295   296   297   298   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

+

. When two objects of type 



ThreeD

 are operated on by the 



+

 operator, the magnitudes of 

their respective coordinates are added together, as shown in 

operator+( )

. Notice, however, 

that this method does not modify the value of either operand. Instead, a new object of type 

ThreeD

, which contains the result of the operation, is returned by the method. To understand 

why the 

+

 operation does not change the contents of either object, think about the standard 

arithmetic

+

 operation as applied like this: 10 + 12. The outcome of this operation is 22, but 

neither 10 nor 12 is changed by it. Although no rule prevents an overloaded operator from 

altering the value of one of its operands, it is best for the actions of an overloaded operator 

to be consistent with its usual meaning.

Notice that 




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   291   292   293   294   295   296   297   298   ...   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