ANSWERS
What structure is commonly used to iterate over all the elements of a two dimensional
array? - Answer- a nested loop
The index of the last element of an array with a size of 5 elements is _____. - Answer- 4
Which keyword is used in Java to define a class? - Answer- class
Which keyword is used in Java to create an object? - Answer- new
The Java keywords "public" and "private" are called _____. - Answer- access modifiers
An object's attributes are implemented as _____. - Answer- variables
When there are no remaining references to an object, the object will be _____. -
Answer- destroyed
The Java keyword used to declare that a method does not return a value is _____. -
Answer- length
Which of the following is a major functional limitation of arrays? - Answer- arrays have a
fixed size
Which method can be called to get the size (number of elements) of an ArrayList? -
Answer- count
In java, functions are called - Answer- methods
The Java statement counter++ will - Answer- add 1 to the variable count
To help us collect information from the user through the keyboard in Java, we use a -
Answer- Scanner
Every Java program consists of at least one - Answer- class definition
what are operations - Answer- things an object does
, An object's attributes are implemented as - Answer- variables
In Java class members are declared with the keyword - Answer- static
A default constructor takes _____ arguments - Answer- 0
Java boolean literal values are expressed in all lowercase - Answer- true
The java expression like the one below will evaluate to ________.
new Bunny("Flopsy", 8) - Answer- an object reference
A reference type variable stores a _____________ - Answer- reference
If a reference type variable does not store a reference to an object, then it stores
__________.
a null reference
Track progress - Answer- a null reference
All of the Java primitive types are _______. - Answer- value types
The two kinds of types in the Java programming language are ___________. - Answer-
value and reference types
Track progress
declare an array of integers in Java? - Answer- int[] my_array;
declare and instantiate an array of 5 integers in Java? - Answer- int[] my_array = new
int[5];
In java, a two dimensional array in Java is - Answer- an "array of arrays."
In Java, arrays are - Answer- reference types
Which methods can be used to replace an element in an ArrayList - Answer- set
Which method can be called to remove all elements from an ArrayList at once? -
Answer- clear
Which method can be used to remove an element from an ArrayList? - Answer- remove
Java ArrayLists are like re-sizable arrays - Answer- true
Which method can be used to insert an element into an ArrayList? - Answer- add
Java uses the keyword ________ to return a value from a method - Answer- return7