mini exam 2

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

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:01 PM on 9/21/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

exception

an event that occurs during the execution of a program that encounters an error or some kind of exceptional situation

2
New cards

when do exceptions happen?

at runtime

3
New cards

exceptions should be _______ instead of _______

handled, avoided

4
New cards

when an exception occurs, two things happen (1)

an exception object is created and thrown

5
New cards

when an exception occurs, two things happen (2)

the normal flow of control is disrupted

6
New cards

stack trace

tells the user which methods were active when the program crashed

7
New cards

propogated

when the exception object is thrown/passed back to its calling method

8
New cards

try block

code that can thrown an exception

9
New cards

catch block

code for how you want to deal with the exception

10
New cards

unchecked exceptions

do not have to be caught; compiler will not generate an error message, but if there is a problem the program will crash at runtime

11
New cards

unchecked exceptions (ex:)

ArithmeticException, NullPointerException, NumberFormatException, StringIndexOutOfBoundsExceptionh

12
New cards

checked exception

must be caught or explicity propagated to the calling method; an error message at compile time

13
New cards

java.lang.RuntimeException

ensures an unchecked exception

14
New cards

throw keyword

is used to explicitly throw an exception

15
New cards

throws keyword

used to indicate that a method might throw a checked exception and propagate it

16
New cards

role of the interface

to define the set of behaviors (methods) that all of the implementing classes must contain

17
New cards

what is the goal of the interface?

to define the methods that each class must contain

18
New cards

contract

the interface is the _______ that each implementing class must follow

19
New cards

implementing classes

combining the interface with regular classes that provide implementations for the abstract methods

20
New cards

implements keyword

used by a class to implement an interface

21
New cards

inheritance

a way to create a new class based on an existing class without the need to manually copy-paste the source code

22
New cards

parent class, super class, base class

the original class you want to extend

23
New cards

child class, subclass, derived class

the new class you want to create based on the parent class

24
New cards

class hierarchy

a collection of classes related by inheritance

25
New cards

extends keyword

is used in the same class declaration of a child class to set up the inheritance relationship

26
New cards

java.lang.Object

superclass of all other classes

27
New cards

super keyword

how a child constructor can call the parent’s constructor on the first line of the child constructor

28
New cards

abstract methods

a non static (instance) method without an implementation (body)

29
New cards

constants

variables that are declared using the final keyword

30
New cards

-

private

31
New cards

~

package private

32
New cards

#

protected

33
New cards

+

public