Question
Question 74 pts What should you check for when calculating the largest value in an array list? The array list contains the maximum value in
Question 74 pts
What should you check for when calculating the largest value in an array list?
The array list contains the maximum value in the first element. |
The array list contains at least one element. |
The array list contains the minimum value in the first element. |
The array list contains at least two elements. |
Flag this Question
Question 84 pts
Your program needs to store an integer sequence of unknown length. Which of the following is most suitable to use?
An array declared as int[] marks; |
A array list declared as ArrayList |
An array declared as int marks[10000]; |
An array declared as int marks[10]; |
Flag this Question
Question 94 pts
Which method call represents the invocation of a method that does not have arguments?
printError("File not found!"); |
printError(); |
printError(""); |
printError |
Flag this Question
Question 104 pts
Which of the following statements about methods is correct?
A method does not need to be defined inside a class. |
A method can have only one parameter. |
Every method must have a return value. |
The return value of a method can be used as an argument to another method. |
Flag this Question
Question 114 pts
What is the declared return type for a method that does not have a return value?
All methods must return a value. |
empty |
void |
byte |
Flag this Question
Question 124 pts
Assume the method doSomething has been defined as follows:
public static void doSomething (int[] values, int p1, int p2)
{
int temp = values[p1];
values[p1] = values[p2];
values[p2] = temp;
}
What does the method do?
It moves each element of the array values to a higher index position. |
It inserts a new value into the array values. |
It swaps the integer values stored in positions p1 and p2 of the array values. |
It copies the integer array values to a new array. |
Flag this Question
Question 134 pts
Which one of the following statements is true about using arrays with methods?
A method can only accept arguments that are elements of an array, but not the whole array. |
A method may accept an argument that is an array, but it cannot return a result that is an array. |
Arrays can be method arguments, and return values, just like any other values. |
If a method is defined to have an array as a method argument, it must also define the size of the array as another method argument. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started