C# 0 The Complete Reference


PART I C h a p t e r   2 0



Download 4,07 Mb.
Pdf ko'rish
bet765/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   761   762   763   764   765   766   767   768   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART I

C h a p t e r   2 0 :  

U n s a f e   C o d e ,   P o i n t e r s ,   N u l l a b l e   T y p e s ,   a n d   M i s c e l l a n e o u s   T o p i c s  

603


PART IPART I

P

Q



P | Q

P & Q


true

null


true

null


false

null


null

false


null

true


true

null


null

false


null

false


null

null


null

null


One other point: When the 

!

 operator is applied to a 



bool?

 value that is 



null

, the 


outcome is 

null

.

Partial Types

Beginning with C# 2.0, a class, structure, or interface definition can be broken into two or 

more pieces, with each piece residing in a separate file. This is accomplished through the 

use of the 

partial

 keyword. When your program is compiled, the pieces are united.

When used to create a partial type, the 

partial

 modifier has this general form:

partial

type typename

 { // ...

Here, 

typename

 is the name of the class, structure, or interface that is being split into pieces. 

Each part of a partial type must be modified by 

partial

.

Here is an example that divides a simple XY coordinate class into three separate files. 



The first file is shown here:

partial class XY {

  public XY(int a, int b) {

    X = a;

    Y = b;

  }


}

The second file is shown next:

partial class XY {

  public int X { get; set; }

}

The third file is



Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   761   762   763   764   765   766   767   768   ...   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