Java (Chapter 7/8) Word Scramble
|
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
| Question | Answer |
| When is the memory allocated for an array. | The memory is allocated when the array is created. |
| How do you access elements in an array? | You access an array using its index. arrayRefVar[index] is known as an array indexed variable. |
| What is the representation of the third element in an array called a? | a[2] |
| If you declare an array double [] list = {3.4, 2.0, 3.5, 5.5}; list[1] is __________. | 2.0 |
| If you declare an array double [] list = {3.4, 2.0, 3.5, 5.5}; the highest index in array list is ________. | 3 |
| How many elements are in array double [] list = new double [5]? | 5 |
| What is the correct term for numbers[99]? | indexed variable |
| Assume int [] t = {1, 2, 3, 4}. What is t.length? | 4 |
| When you pass an array to a method, the method receives _________. | the reference of the array |
| The JVM stores the array in an area of memory, called _______, which is used for dynamic memory allocation where blocks of memory are allocated and freed in an arbitrary order. | heap |
| When you return an array from a method, the method returns __________. | the reference of the array |
| The _________ method sorts the array scores of the double [] type. | java.util.Arrays.sort(scores) |
| Assume int [] scores = {1, 20, 30, 40, 50}; what value does java.util.Arrays.binarySearch(scores, 30) return? | 2 |
| Assume int [] scores = {1, 20, 30, 40, 50}; what is the output of System.out.println(java.util.Arrays.toString(scores));? | [1, 20, 30, 40, 50] |
| How can you get the word "abc" in the main method from the following call? [java Test "+" 3 "abc" 2] | args[2] |
| Assume double [][] x = new double [4][5]; what are x.length and x[2].length? | 4 and 5 |
| What is the index variable for the element at the first row and first column in array a? | a[0][0] |
| When you create an array using the following statement, the element values are automatically initialized to 0. "int [][] matrix = new int [5][5];" | True |
| The ____________ method copies the sourceArray to the targetArray. | System.arraycopy(sourceArray, 0, targetArray, 0, sourceArray.length); |
Created by:
Smurfette42
Popular Computers sets