1/14
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
limitation of arrays
it has a fixed length, and can only store, one specific type of data.
NullPointerException
Extra spaces will simply be ignored, and once you reach one it will result in a
ArrayList
is a solution for this issue.
ArrayList object
is dynamically sized
dynamically sized
it can become smaller or larger as elements are added or removed.
typed ArrayList
ArrayLists are very adaptable, so if you need to make an ArrayList set to a specific type, you set it up as
Integer and Double objects
can be created with integers and doubles, as parameters.
Integer class
The static variables of MIN_VALUE, and MAX_VALUE found in the
Elements
can be accessed with index notation.
Give example of methods used to access ArrayList.
myList.get(2), myList.add(“Bob”)
static variables
it store the minimum and maximum values of an integer.
int and double
The primitive data types that can’t be stored in ArrayLists.
Parameters
Integer and Double objects can be created with integers and doubles
Integer n
new Integer (5);
Double x
new Double (6.1);