Throwable Flashcards

1
Q

FileNotFound

A

Exception Checked

when trying to access a file that can’t be found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ArrayIndexOutOfBounds

A

Exception Runtime

when trying to access out of bounds array index.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

IndexOutOfBounds

A
Exception Runtime
(subclass ArrayIndexOutOfBoundsException)  - when trying to access out of bounds list (such as arrayList) index
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ClassCast

A

Exception Runtime

when trying to cast an object to an incompatible reference. (see castings notes for more details)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

IllegalArgument

A

Exception Runtime

used when trying to put inappropriate values, but still of the right type, in as method arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

IllegalState

A

Exception Runtime

used when trying to modify an object that that is not in appropriate state (e.g. sms text already sent out)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

NullPointer

A

Exception Runtime
when trying to to call a method with a null reference variable.
*local variables are not auto initialized with default values, not even with a null value. trying to work with these unitized variables will lead to compile time problems.
* reaching into the index of an array that is actually null gives nullpointerrefference.
*sending null to toString gives null pointer reference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

NumberFormat

A

Exception Runtime
(subclass IllegalArgumentException) when trying to convert a string to a number that just can’t become a number.
*The method used is IntegerparseInt(String)/IntegerparseInt(String, int base).
* - and + prefixes are fine
* underscores _ in the string values are not okay.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

ExceptionInInitializer

A

Error
(subclass linkage error) - when a static block throws a runtime exception
*can also occur when the initialization of a static variable throws a runtime exception. could be a call to a static method that throws it or the
*static blocks are called when the class loads.
*initilizer blocks are called when an object is created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

StackOverflow

A
Error
(subclass virtual machine error) - when a method calls itself so many times, the jvm runs out of memory. Tis the case when you see a recursive call with no exit condition.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

NoClassDefFound

A
Error
(subclass linkage error) when jvm or class loader instance tries to load a class but definition is not found. Sometimes confused with classnotfoundexception which is thrown by class.forName()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

OutOfMemory

A
Error
(subclass virtual machine error) - when so many objects are created and used that the heap runs out of memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly