C# 0 The Complete Reference


string type. The  foreach



Download 4,07 Mb.
Pdf ko'rish
bet201/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   197   198   199   200   201   202   203   204   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

string

type. The 



foreach

 loop is also examined.



Arrays

An

array

 is a collection of variables of the same type that are referred to by a common name. 

In C#, arrays can have one or more dimensions, although the one-dimensional array is the 

most common. Arrays are used for a variety of purposes because they offer a convenient 

means of grouping together related variables. For example, you might use an array to hold 

a record of the daily high temperature for a month, a list of stock prices, or your collection 

of programming books.

The principal advantage of an array is that it organizes data in such a way that it can 

be easily manipulated. For example, if you have an array containing the dividends for a 

selected group of stocks, it is easy to compute the average income by cycling through the 

array. Also, arrays organize data in such a way that it can be easily sorted.

Although arrays in C# can be used just like arrays in many other programming languages, 

they have one special attribute: They are implemented as objects. This fact is one reason that 

a discussion of arrays was deferred until objects had been introduced. By implementing 

arrays as objects, several important advantages are gained, not the least of which is that 

unused arrays can be garbage-collected.


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   197   198   199   200   201   202   203   204   ...   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