C# 0 The Complete Reference


MyMeth( )  is encountered in  Main( )



Download 4,07 Mb.
Pdf ko'rish
bet621/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   617   618   619   620   621   622   623   624   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

MyMeth( )

 is encountered in 



Main( )

 when this program is compiled, 

a warning will be generated that tells the user to use 

MyMeth2( )

 instead.

A second form of 

Obsolete

 is shown here:

[Obsolete(“

message

”,

error

)]

Here, 


error

 is a Boolean value. If it is true, then use of the obsolete item generates a 

compilation error rather than a warning. The difference is, of course, that a program 

containing an error cannot be compiled into an executable program.

www.freepdf-books.com



This page intentionally left blank 

www.freepdf-books.com




18

Generics


T

his chapter examines one of C#’s most sophisticated and powerful features: 



generics.

Interestingly, although generics are now an indispensable part of C# programming, 

they were not included in the original 1.0 release. Instead, they were added by C# 2.0. 

It is not an overstatement to say that the addition of generics fundamentally changed the 

character of C#. Not only did it add a new syntactic element, it also added new capabilities 

and resulted in many changes and upgrades to the library. Although it has been a few years 

since the inclusion of generics in C#, the effects still reverberate throughout the language.

The generics feature is so important because it enables the creation of classes, structures, 

interfaces, methods, and delegates that work in a type-safe manner with various kinds of 

data. As you may know, many algorithms are logically the same no matter what type of 

data they are being applied to. For example, the mechanism that supports a queue is the 

same whether the queue is storing items of type 




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   617   618   619   620   621   622   623   624   ...   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