Which of the following statements correctly uses a reference to the entire array
ID: 3792687 • Letter: W
Question
Which of the following statements correctly uses a reference to the entire array myArray as the argument of the method call? (The method call comes from within the same class, so no qualifier is needed.)
public void myMethod( int[ ] a ) { ... }
An array of doubles is stored in the variable v as shown below. Which statement below will print some or all of the contents of the array with NO errors (syntax or logical)?
int vSize = 5;
double[ ] v = new double[vSize];
for (int i = 0; i < vSize; i++)
v[i] = 1.1;
Which of the following method signatures correctly specifies an array as a return type?
Which of the following is the BEST description of a 2-D array in Java?
A loop is being used to find the lowest value in a double array named numbers. Which of the following statements performs a useful initialization of the accumulator?
myMethod( myArray );Explanation / Answer
public void myMethod( int[ ] a ) { ... }
myMethod( myArray );
myMethod( myArray[ ] );
myMethod( myArray[ 0 ] );
All of the above
Ans:myMethod( myArray );
=========================
Which of the following method signatures correctly specifies an array as a return type?
Ans: private int[ ] testMethod ( int x )
===================={==
Which of the following is the BEST description of a 2-D array in Java?
a 2-D array is a table
a 2-D array is an array of arrays
a 2-D array is a matrix
a 2-D array is a nested loop
a 2-D array is an ArrayList
Ans: a 2-D array is an array of arrays
==============================
A loop is being used to find the lowest value in a double array named numbers. Which of the following statements performs a useful initialization of the accumulator?
double lowestValue = 0;
double lowestValue = numbers;
double lowestValue = numbers[0];
double lowestValue; // no initialization needed
Any of the above.
Ans:
double lowestValue = numbers[0];
private array testMethod ( int x )Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.