Save
COMPUTER PROGRAMMING 2
UNIT 5.
Lesson 5.2
Save
Share
Learn
Content
Leaderboard
Learn
Created by
CHRISTINE JOY
Visit profile
Cards (11)
try block
Identifies a
block
of
code
for which particular
exceptions
will be
activated
Catching exceptions
Specify what type of exception to catch
catch
A program catches an exception with an exception handler at the place in a program where you want to handle the problem
Exception handling
A way to transfer control from one part of a program to another
An
exception
is a problem that
arises
during the execution of a program
Throwing exceptions
Can be done anywhere within a code block using
throw statement
C++ exception
A response to an
exceptional circumstance that arises while
a
program is running
, such as an
attempt
to divide by zero
Exception
type
Determined by the type of the result of the expression following the throw keyword
throw
A program throws an exception when a problem shows up
C++ exception handling
try
catch
throw
Exception declaration
Determines the type of
exception caught