This keyword denotes that the value of a variable cannot be updated, for example when using a constant, like the speed of light.
What is final?
If a recursive method doesn't have a condition to stop the recursions, we get a run-time error called...
What is an infinite loop?
In a method to find the maximum value in an array called "prices", we initialize the variable holding the maximum to this value...
What is prices[0]?
(or the first element in prices)
ArrayLists can't store this type of data. (Which is a reason why wrapper classes and autoboxing are needed)
What are primitives?
What is the index of the bottom right element in a 4 x 8 array?
What is [3][7]?
(coordinates ok)
This term refers to writing more than one version of a method using the same name, but different parameters.
What is overloading?
The condition that stops recursive calls.
What is the base case?
Write a "for i" loop condition to traverse the elements in an array of Strings called nbaTeams.
You must be completely accurate
for (int i = 0; i<nbaTeams.length; i++)
Write a "for i" loop condition to traverse the elements in an ArrayList of Strings called nbaTeams, in REVERSE.
You must be completely accurate.
for (int i = nbaTeams.size() - 1; i >=0; i-- )
Write a "for i" loop condition to traverse the elements in an array of Strings called nbaTeams.
You must be completely accurate
Declare and initialize an array called "letters" with these values:
a b c
d e f
What is String letters = {{a,b,c}, {d,e,f}};
The automatic conversion the Java compiler makes between primitive types and their wrapper classes. For example, converting an int to an Integer, or a double to a Double
What is autoboxing?
A method is recursive when it does this.
What is calls itself?
Write an enhanced for loop condition to traverse an array of Animal objects called zoo. (zoo is the array name)
for (Animal beast: zoo)
(local variable name "beast" can vary
While traversing an Arraylist using the condition for (Student cougar : roster), write a condition to check if the current element has the name "Jair"
What is... if (warrior.getName().equals("Jair"))?
Declare a 10 x 5 array of doubles called "prices"
What is double[][] prices = new double[10][5];
This phrase describes the fact that if the first part of an AND conditional is false, the second part is not checked.
What is short circuit evaluation?
Here is an example of this technique, in this case used to override integer division:
(double)10/3
What is casting?
An enhanced for loop can only traverse an array or ArrayList in this way.
What is from beginning to end? (answers may vary)
Write a single command that would declare and initialize an ArrayList of Integers called "ages" (you don't need to populate it).
What is ArrayList<Integer> ages = new ArrayList<>();
Write the conditions for a nested for loop to traverse a 2D array of integers called stuff. You can leave out curly brackets.
for (int r = 0; r < stuff.length; r++)
{
for (int c = 0; c < stuff[0].length; c++)
{
(local variable names may vary)
This keyword indicates that a private variable value is shared by ALL objects of a class, for example "totalStudents".
What is a static?
This type of method allows us to print an objects information using the command System.out.print().
What is toString()?
Write a command to access the name of a Student object at index i, in an array called roster.
(Assume conventional getter names.)
What is roster[i].getName() ?
Write a command that would set the name of an Animal at index 5 in an arrayList called pets to "Captain". Animal has a setName method that takes a String.
What is pets.get(5).setName("Captain");
Write the conditions for a nested "for i" loop to traverse a 2D array called stuff. You can leave out curly brackets.
for(int r = 0; r < stuff.length; r++)
for(int c = 0; c < stuff[0].length; c++)