C# Language Specification


Try-catch-finally statements



Download 0,75 Mb.
bet128/524
Sana06.01.2022
Hajmi0,75 Mb.
#324842
1   ...   124   125   126   127   128   129   130   131   ...   524
Bog'liq
CSharp Language Specification

Try-catch-finally statements


Definite assignment analysis for a try-catch-finally statement of the form:

try try-block


catch(...) catch-block-1
...
catch(...) catch-block-n
finally finally-block

is done as if the statement were a try-finally statement enclosing a try-catch statement:

try {
try try-block
catch(...) catch-block-1
...
catch(...) catch-block-n
}
finally finally-block

The following example demonstrates how the different blocks of a try statement (§8.10) affect definite assignment.

class A
{
static void F() {
int i, j;
try {
goto LABEL;
// neither i nor j definitely assigned
i = 1;
// i definitely assigned
}

catch {
// neither i nor j definitely assigned


i = 3;
// i definitely assigned
}

finally {


// neither i nor j definitely assigned
j = 5;
// j definitely assigned
}
// i and j definitely assigned
LABEL:;
// j definitely assigned

}
}


        1. Download 0,75 Mb.

          Do'stlaringiz bilan baham:
1   ...   124   125   126   127   128   129   130   131   ...   524




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