1. An array is a container that holds a group of values of a 2. Each item in an array is called an 3. Each element is accessed by a numerical 4. The index to the first element of an array is 0 and the index to the last element of the array is the length of the 5. Given the following array declaration, determine which of the three statements below it are true. int [] autoMobile = new int [13]; i. autoMobile[0] is the reference to the first element in the array. ii. autoMobile[13] is the reference to the last element in the array. ii. There are 13 integers in the autoMobile array. 6. In java new is a which is used to allocate memory

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question
1. An array is a container that holds a group of values of a
2. Each item in an array is called an
3. Each element is accessed by a numerical
4. The index to the first element of an array is 0 and the
index to the last element of the array is the length of the
5. Given the following array declaration, determine which of
the three statements below it are true.
int [] autoMobile = new int [13];
i. autoMobile[0] is the reference to the first element in
the array.
ii. autoMobile[13] is the reference to the last element in
the array.
ii. There are 13 integers in the autoMobile array.
6. In java new is a
which is used to allocate
memory
7. Declare a one-dimensional array named score of type int
that can hold9 values.
8. Declare and initialize a one-dimensional byte array
named values of size 10 so that all entries contain 1.
9. Declare and initialize a one-dimensional array to store
name of any 3 students.
10. Declare a two-dimensional array named mark of type
double that can hold 5x3 values.
11. What is the output of the given program?
String[][] names = { {"Mr. ", "Mrs. ", "Ms. "},
{"Smith", "Jones"} };
System.out.println(names[0][0] + names[1][0]);
System.out.println(names[0][2] + names[1][1]);
Transcribed Image Text:1. An array is a container that holds a group of values of a 2. Each item in an array is called an 3. Each element is accessed by a numerical 4. The index to the first element of an array is 0 and the index to the last element of the array is the length of the 5. Given the following array declaration, determine which of the three statements below it are true. int [] autoMobile = new int [13]; i. autoMobile[0] is the reference to the first element in the array. ii. autoMobile[13] is the reference to the last element in the array. ii. There are 13 integers in the autoMobile array. 6. In java new is a which is used to allocate memory 7. Declare a one-dimensional array named score of type int that can hold9 values. 8. Declare and initialize a one-dimensional byte array named values of size 10 so that all entries contain 1. 9. Declare and initialize a one-dimensional array to store name of any 3 students. 10. Declare a two-dimensional array named mark of type double that can hold 5x3 values. 11. What is the output of the given program? String[][] names = { {"Mr. ", "Mrs. ", "Ms. "}, {"Smith", "Jones"} }; System.out.println(names[0][0] + names[1][0]); System.out.println(names[0][2] + names[1][1]);
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage