C# 0 The Complete Reference


switch  statement. As mentioned, because enumerations are integral  types, they are perfectly valid for use in a  switch



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

switch

 statement. As mentioned, because enumerations are integral 

types, they are perfectly valid for use in a 

switch

.

www.freepdf-books.com




This page intentionally left blank 

www.freepdf-books.com




13

Exception Handling

A

n

exception



 is an error that occurs at runtime. Using C#’s exception handling 

subsystem, you can, in a structured and controlled manner, handle runtime errors. 

A principal advantage of exception handling is that it automates much of the error-

handling code that previously had to be entered “by hand” into any large program. For 

example, in a computer language without exception handling, error codes must be returned 

when a method fails, and these values must be checked manually each time the method is 

called. This approach is both tedious and error-prone. Exception handling streamlines error-

handling by allowing your program to define a block of code, called an 



exception handler, 

that is executed automatically when an error occurs. It is not necessary to manually check 

the success or failure of each specific operation or method call. If an error occurs, it will be 

processed by the exception handler.

Exception handling is also important because C# defines standard exceptions for common 

program errors, such as divide-by-zero or index-out-of-range. To respond to these errors, 

your program must watch for and handle these exceptions. In the final analysis, to be a 

successful C# programmer means that you are fully capable of navigating C#’s exception-

handling subsystem.


Download 4,07 Mb.

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