C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet436/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   432   433   434   435   436   437   438   439   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

DivideByZeroException

exception is generated. As you will see later in this chapter, you can create your own 

exception classes by deriving them from 

Exception

.

337



CHAPTER

www.freepdf-books.com




338

 

P a r t   I :  



T h e   C #   L a n g u a g e

Exception Handling Fundamentals

C# exception handling is managed via four keywords: 



try

,

catch

,

throw

, and 


finally

.

They form an interrelated subsystem in which the use of one implies the use of another. 



Throughout the course of this chapter, each keyword is examined in detail. However, it 

is useful at the outset to have a general understanding of the role each plays in exception 

handling. Briefly, here is how they work.

Program statements that you want to monitor for exceptions are contained within a 



try

 block. If an exception occurs within the 



try

 block, it is 



thrown.

 Your code can catch this 

exception using 

catch

 and handle it in some rational manner. System-generated exceptions 

are automatically thrown by the runtime system. To manually throw an exception, use the 

keyword 


throw

. Any code that absolutely must be executed upon exiting from a 




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   432   433   434   435   436   437   438   439   ...   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