C# 0 The Complete Reference


base . When a derived class specifies a  base



Download 4,07 Mb.
Pdf ko'rish
bet372/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   368   369   370   371   372   373   374   375   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

base

. When a derived class specifies a 



base

clause, it is calling the constructor of its immediate base class. Thus, 



base

 always refers 

to the base class immediately above the calling class. This is true even in a multileveled 

hierarchy. You pass arguments to the base constructor by specifying them as arguments to 



base

. If no 


base

 clause is present, then the base class’ default constructor is called 

automatically.

Inheritance and Name Hiding

It is possible for a derived class to define a member that has the same name as a member in 

its base class. When this happens, the member in the base class is hidden within the derived 

class. While this is not technically an error in C#, the compiler will issue a warning message. 

This warning alerts you to the fact that a name is being hidden. If your intent is to hide a 

base class member, then to prevent this warning, the derived class member must be preceded 

by the 

new

 keyword. Understand that this use of 



new

 is separate and distinct from its use 

when creating an object instance.

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   368   369   370   371   372   373   374   375   ...   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