Question: QUESTION 15 In a Java class, the name of a constructor can be anything but the same as the name of the class. True False
QUESTION 15
In a Java class, the name of a constructor can be anything but the same as the name of the class.
True
False
2 points
QUESTION 16
A local variable is an variable that is declared within a method and that is visible only within that method.
True
False
2 points
QUESTION 17
Arrays can be initialized when they are created.
True
False
2 points
QUESTION 18
Arrays cannot be passed as parameters into methods, but their elements can be passed individually.
True
False
2 points
QUESTION 19
The Java operator new is needed to instantiate an object (i.e. create an instance of a Java class).
True
False
2 points
QUESTION 20
An exception is thrown when an array index goes out of bounds.
True
False
2 points
QUESTION 21
The class ArrayList is contained in the package java.util.
True
False
2 points
QUESTION 22
An array index can be any expression that evaluates to a non-negative integer. The value of the index must always be less than the size of the array.
True
False
2 points
QUESTION 23
In Java, [ ] is an operator, called the array subscripting operator.
True
False
2 points
QUESTION 24
To access an element of a two-dimensional array, you need a pair of indices: one for the row position, and one for the column position.
True
False
2 points
QUESTION 25
If an array index is less than zero, an InvalidIndexException exception is thrown.
True
False
2 points
QUESTION 26
You cannot override the default definition of the method toString because it is provided by Java Object class.
True
False
2 points
QUESTION 27
In a method call statement, when passing an array as an actual parameter, you use only its name.
True
False
2 points
QUESTION 28
To determine whether two reference variables of the Integer type point to the same Integer object, we can use either the method equals of the class Integer or the operator ==.
True
False
2 points
QUESTION 29
This is automatically provided for a java class if you do not write one yourself.
| accessor method | ||
| default instance | ||
| default constructor | ||
| variable declaration |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
