1/11
Looks like no tags are added yet.
Characteristics of ArrayList?
Grows automatically
Shifts when removing elements
Can have elements of multiple types
No primitive types as type ArrayList use wrapper methods
What is a set?
its a list that doesn’t allow duplicates
doesn’t preserve order
has no index methods
What is a map?
A list that stores key - value pairs
Keys are uniqe
Value can be duplicated
Iterator hasNext()
checks if a another elements is available
Iterator Next()
returns the next element
What is the fail fast aspect?
Once iterator created expects the collection to remain unchanged, after modification iterator becomes invalid
What is an exception?
An exception is an event that occurs at runtime and interrupts the normal execution of a program.
How do you write an exception handler
Using a try catch block
Key aspect of nested try catch blocks?
If the inner catch can’t handle the error, java checks the outer block
What does the finally block do?
Performs operations whether or not an exception occurs.
What is the characteristic of Checked Exceptions?
They are required by the compiler to be caught using a try except block / declared using throws
What is the characteristic of Unchecked Exceptions?
They are not required by the compiler to be caught using a try except block / declared using throws