C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet400/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   396   397   398   399   400   401   402   403   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

Equals(object, object)

 method invokes 



Equals(object)

 to compute its result.

The

GetHashCode( )

 method returns a hash code associated with the invoking object. 

This hash code can be used with any algorithm that employs hashing as a means of 

accessing stored objects.

As mentioned in Chapter 9, if you overload the 

= =

 operator, then you will usually need 

to override 

Equals(object)

 and 


GetHashCode( )

 because most of the time you will want 

the

= = 

operator and the 



Equals(object)

 methods to function the same. When 



Equals( )

is overridden, you should also override 



GetHashCode( )

, so that the two methods are 

compatible.

The


ToString( )

 method returns a string that contains a description of the object on 

which it is called. Also, this method is automatically called when an object is output using 

Method


Purpose

public vir tual bool Equals(object 



ob

)

Determines whether the invoking object is the 



same as the one referred to by 

ob.

public static bool Equals(object 



ob1

, object 



ob2

)

Determines whether 



ob1

 is the same as 



ob2.

protected vir tual Finalize( )

Per forms shutdown actions prior to garbage 

collection. In C#, 

Finalize( )

 is accessed through 

a destructor.

public vir tual int GetHashCode( )

Returns the hash code associated with the 

invoking object.

public Type GetType( )

Obtains the type of an object at runtime.

protected object Member wiseClone( )

Makes a “shallow copy” of the object. This 

is one in which the members are copied, but 

objects referred to by members are not.

public static bool ReferenceEquals(object 

ob1

,

                                                    object 



ob2

)

Determines whether 



ob1

 and 


ob2

 refer to the 

same object.

public vir tual string ToString( )

Returns a string that describes the object.

T

ABLE



 11-1 

Methods of the 

object

 Class


www.freepdf-books.com


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   396   397   398   399   400   401   402   403   ...   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