C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet796/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   792   793   794   795   796   797   798   799   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

The Boolean Structure

The


Boolean

 structure supports the 



bool

 data type. The methods defined by 



Boolean

 are 


shown in Table 21-10. It defines these fields:

public static readonly string FalseString

public static readonly string TrueString

These contain the human-readable forms of 



true

 and 


false

. For example, if you output 



FalseString

 using a call to 



WriteLine( )

, the string “False” is displayed.



Boolean

 implements the following interfaces: 



IComparable

,

IComparable

,

IConvertible

, and 


IEquatable

.

Method



Meaning

public int CompareTo(bool 



v

)

Compares the value of the invoking object with that of 



v.

Returns zero if the values are equal. Returns a negative 

value if the invoking object is false and 

v

 is true. Returns 

a positive value if the invoking object is true and 

v

 is false. 

public int CompareTo(object 

v

)

Compares the value of the invoking object with that of 



v.

Returns zero if the values are equal. Returns a negative 

value if the invoking object is false and 

v

 is true. Returns 

a positive value if the invoking object is true and 

v

 is false. 

public bool Equals(bool 

v

)

Returns true if the value of the invoking object equals the 



value of 

v. 

public override bool Equals(object 



v

)

Returns true if the value of the invoking object equals the 



value of 

v.

public override int GetHashCode( )

Returns the hash code for the invoking object.

public TypeCode GetTypeCode( )

Returns the 

TypeCode


 enumeration value for 

Boolean


,

which is 

TypeCode.Boolean

.

public static bool Parse(string 



str

)

Returns the 



bool

 equivalent of the string in 



str.

 If the string 

is neither 

Boolean.TrueString

 nor 

Boolean.FalseString



, a 

FormatException

 is thrown. However, case differences are 

ignored.


public override string ToString( )

Returns the string representation of the value of the invoking 

object, which will be either 

TrueString

 or 

FalseString



.

public string

     ToString(IFormatProvider 

fmtpvdr

)

Returns the string representation of the value of the 



invoking object, which will be either 

TrueString

 or 

FalseString



. The 

fmtpvdr

parameter is ignored.

T

ABLE


 21-10 

Methods Defi ned by 

Boolean

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   792   793   794   795   796   797   798   799   ...   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