C# 0 The Complete Reference


+ operator to add an object to the list. A class that implements a stack might use the  +



Download 4,07 Mb.
Pdf ko'rish
bet291/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   287   288   289   290   291   292   293   294   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

+

operator to add an object to the list. A class that implements a stack might use the 



+

 to push 

an object onto the stack. Another class might use the 

+

 operator in an entirely different way.

When an operator is overloaded, none of its original meaning is lost. It is simply that a new 

operation, relative to a specific class, is added. Therefore, overloading the 



+

 to handle a linked 

list, for example, does not cause its meaning relative to integers (that is, addition) to be changed.

A principal advantage of operator overloading is that it allows you to seamlessly 

integrate a new class type into your programming environment. This 

type extensibility

 is an 


important part of the power of an object-oriented language such as C#. Once operators are 

defined for a class, you can operate on objects of that class using the normal C# expression 

syntax. You can even use an object in expressions involving other types of data. Operator 

overloading is one of C#’s most powerful features.




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   287   288   289   290   291   292   293   294   ...   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