C# 0 The Complete Reference


GC . However, in  specialized cases, they can be very useful. For example, you might want to use  Collect( )



Download 4,07 Mb.
Pdf ko'rish
bet812/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   808   809   810   811   812   813   814   815   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

GC

. However, in 

specialized cases, they can be very useful. For example, you might want to use 

Collect( )

 to 


force garbage collection to occur at a time of your choosing. Normally, garbage collection 

occurs at times unspecified by your program. Since garbage collection takes time, you might 

not want it to occur during some time-critical task, or you might want to take advantage of 

idle time to perform garbage collection and other types of “housekeeping” chores.

Method

Meaning


public vir tual int Next( )

Returns the next random integer, which will be 

between 0 and 

Int32.MaxValue

–1, inclusive.

public vir tual int Next(int 



upperBound

)

Returns the next random integer that is between 0 



and

upperBound

–1, inclusive.

public vir tual int Next(int 

lowerBound

,

                                int 



upperBound

)

Returns the next random integer that is between 



lowerBound

 and 


upperBound

–1, inclusive.

public vir tual void NextBytes(byte[ ] 

buf

)

Fills 



buf

 with a sequence of random integers. 

Each byte in the array will be between 0 and 

Byte.MaxValue–1

, inclusive.

public vir tual double NextDouble( )

Returns the next random value from the sequence 

represented as a floating-point number that is greater 

than or equal to 0.0 and less than 1.0.

protected vir tual double Sample( )

Returns the next random value from the sequence 

represented as a floating-point number that is greater 

than or equal to 0.0 and less than 1.0. To create 

a skewed or specialized distribution, override this 

method in a derived class.

T

ABLE



 21-14 

Methods Defi ned by 

Random

www.freepdf-books.com




658

 

P a r t   I I :  



E x p l o r i n g   t h e   C #   L i b r a r y

There are two methods that are especially important if you have unmanaged code in 

your project: 


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   808   809   810   811   812   813   814   815   ...   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