This method tells you how many elements are in an Array List.
What is .size() ?
The syntax of a for-each loop.
for (<array type> <element> : <array>)
{
<statements using var>;
}
We provide a name for the method, a parameter
variable for each argument, and a type for its result here.
What is declaring a method?
Every one of these has its own set of data, and methods to manipulate the data.
What is an object?
This will always be 1 larger than the last address of the array. (ex: array[5], this will be 6)
the length of the array, array.length
Common ArrayList tasks, such as inserting and removing elements, are performed this way.
What is using methods from the ArrayList class?
This points variables to their corresponding data.
What is a pointer?
The return type (keyword) for methods where there is no return.
What is void?
An object has both ____ and ________.
What are state and behavior?
What is a for-each loop?
To declare an Array List, this is used (fill in the blank):
ArrayList<String> names = new ___________________;
What is
ArrayList<String>()
?
The syntax for accessing a specific element in a 2D array.
Array[row][column]
If we have a conditional in a method with one if, two else if's, and one else, we need this many return statements.
What is 4 return statements? (One for each possible condition)
This is used to initialize the state of an object when it is created.
What is a constructor?
An array of arrays that has columns and rows.
What is a 2D array?
Array Lists only can contain objects. Thus, you must use this type of class when initializing an Array List.
What is a wrapper class?
(i.e. Double, Boolean, Integer)
The syntax for creating a method.
<access modifier> <return type> <method name> ( <parameters> ){
}
A method that operates on an object's instance variables is called a(n) ________ ______.
What is an instance method?
A private instance variable of an object can be accessed here and only here.
What is only by methods of its class?
An array that can change the number of possible elements within.
What is an array-list?
These are the two criteria for when to use an Array instead of an Array List.
What are
1. When the number of elements will never change
2. When you're using a large collection of primitive types
?
The syntax to encapsulate class variables.
private type variablename = ...;
This type of method is one method used for ALL instances of that type of object for the class.
What is a static method?
Many classes have ________ and _______ methods. These terms describe what the method does.
What are accessor and mutator? (What are getter and setter? also acceptable)
Initializing an Array to equal another Array is not a "true" copy of the Array.
A true copy of an Array is achieved by doing this.
What is using the Arrays.copyOf() method?