Exam 9: Advanced Array Concepts
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
import java.util.*;
public class sortArray
{
public static void main(String[] args)
{
double[] lengths = {120.0, 0.5, 0.0, 999.0, 77.3};
Arrays.sort(lengths);
System.out.println(Arrays.toString(lengths));
}
}
Using the above code, what will be the output of the println statement when the code is executed?
(Essay)
4.7/5
(35)
Match each term with the correct statement below.
-A popularly known sorting method
(Multiple Choice)
4.8/5
(41)
If you do not provide values for the elements in a two-dimensional numeric array, the values default to null.
(True/False)
4.9/5
(29)
The ArrayList class ____ method retrieves an item from a specified location in an ArrayList.
(Multiple Choice)
4.7/5
(37)
Regarding enumerations, the ____ method returns an integer that represents the constant's position in the list of constants; as with arrays, the first position is 0.
(Multiple Choice)
4.8/5
(34)
int[][] myVals = {{2, 4, 6}, {1, 3, 5, 7}};
Using the above array, what is the value of myVals.length?
(Multiple Choice)
4.9/5
(40)
To declare a two-dimensional array in Java, you type two sets of ____ after the array type.
(Multiple Choice)
4.9/5
(36)
int[][] myVals = new int[3][]
myVals[0] = new int[3];
myVals[1] = new int[10];
myVals[2] = new int[5];
The above code depicts a ragged array. What does this mean? Describe the rows and columns that make up this array.
(Essay)
4.8/5
(34)
When you place objects in order beginning with the object that has the lowest value, you are sorting in ____________________ order.
(Short Answer)
4.8/5
(35)
You can add an item at any point in a(n) ____ container and the array size expands automatically to accommodate the new item.
(Multiple Choice)
4.9/5
(32)
Dummy values are a common programming technique used with arrays. Explain the importance of dummy values and how they can be used to ensure that the subscript does not exceed the allowable limit.
(Essay)
4.8/5
(32)
import javax.swing.*;
class FindPoints
{
public static void main(String[] args)
{
int[][] points = {{ 10, 20, 30},
{20, 40, 60},
{40, 60, 80}};
String prompt;
int class;
int level;
prompt = JOptionPane.showInputDialog(null, "Class: ");
class = Integer.parseInt(prompt);
prompt = JOptionPane.showInputDialog(null,
(Essay)
4.8/5
(37)
Showing 61 - 74 of 74
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)