exception handling and templates

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:51 AM on 3/26/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

23 Terms

1
New cards

an exception

undesriable or abnormal event that occurs during program execution

2
New cards

run time error(exeception)

an error that occurs during run time when the program encounters something that cannot run

3
New cards

exception handling

code that runs when an exception occurs

4
New cards

purpose of exception handling

code that runs when an exception occurs

5
New cards

try block

contains code that may produce an exception

6
New cards

throw

signals that an error has occured

7
New cards

catch block

handles the exception

8
New cards

type matching rule

the catch block handles only the type of the exception the code is designed for

9
New cards

no exception behavior

of no exception thrown, all catch blocks are skipped

10
New cards

exception thrown behavior

the try block ends and remaining statements are skipped

11
New cards

multiple catch blocks

only one matching catch block executes

12
New cards

catch all handler(…)

catches any type of exception and should be placed last

13
New cards

order of catch blocks

must go from more specific to less specific

14
New cards

assert

stops the program immediately if a condition is false

15
New cards

throwing an exception

we say that a program throws an exception

16
New cards

user defined exception

a class created by the programmer to handle specific errors

17
New cards

template

allows writing one function or class that works with different data types

18
New cards

function template

a function that can work with any data type using a template parameter

19
New cards

template syntax

template <class T>

20
New cards

template parameter(T)

a placeholder for a data type

21
New cards

generic programming

writing code that works for multiple data types

22
New cards

template function use

the compiler replaces T with the actual data type when the function is called

23
New cards

example idea

instead of writing multiple max functions, use one template function

Explore top notes

note
Key Stuff - All Ideologies
Updated 1017d ago
0.0(0)
note
Aniline differentiation
Updated 351d ago
0.0(0)
note
Chapter 27 - The Cold War
Updated 1441d ago
0.0(0)
note
CGO casus 4
Updated 434d ago
0.0(0)
note
Key Stuff - All Ideologies
Updated 1017d ago
0.0(0)
note
Aniline differentiation
Updated 351d ago
0.0(0)
note
Chapter 27 - The Cold War
Updated 1441d ago
0.0(0)
note
CGO casus 4
Updated 434d ago
0.0(0)

Explore top flashcards

flashcards
Unit 6 Gradesavers Kaji
47
Updated 1102d ago
0.0(0)
flashcards
patho chapter 5
31
Updated 1136d ago
0.0(0)
flashcards
Vocabulary Power Unit 3
42
Updated 414d ago
0.0(0)
flashcards
APUSH Unit 5
111
Updated 1176d ago
0.0(0)
flashcards
english final
53
Updated 104d ago
0.0(0)
flashcards
TUTTO PARZIALE 2
169
Updated 464d ago
0.0(0)
flashcards
troika chapter 4
68
Updated 1119d ago
0.0(0)
flashcards
Unit 6 Gradesavers Kaji
47
Updated 1102d ago
0.0(0)
flashcards
patho chapter 5
31
Updated 1136d ago
0.0(0)
flashcards
Vocabulary Power Unit 3
42
Updated 414d ago
0.0(0)
flashcards
APUSH Unit 5
111
Updated 1176d ago
0.0(0)
flashcards
english final
53
Updated 104d ago
0.0(0)
flashcards
TUTTO PARZIALE 2
169
Updated 464d ago
0.0(0)
flashcards
troika chapter 4
68
Updated 1119d ago
0.0(0)