Question
write the two java statements that declares an array of 20 double values and also creates contiguous memory locations for the array elements. What is
write the two java statements that declares an array of 20 double values and also creates contiguous memory locations for the array elements.
What is the range of valid indexes for array months as defined here?
String months[] = new String[12];
Fill in the value of the variable result in the blanks below?
int arr[] = { 4, 5, 12, 44 };
int result;
int i = 2;
result = arr[2]; // result is now _________
result = arr[3]/4; // result is now _________
result = arr[i / 2]; // result is now _________
Given the following array declaration, what is the value of the expression myArray.length?
String myArray[] = new String[6];
Write a java statement that calls the following method and passes the array from the question above as a parameter?
public static void show(String[] strArr) {
for (int i=0; i< strArr.length; i++)
System.out.println(i + : + strArr[i]);
}
Write out the values of the elements in the array arr after the following section of code executes.
int arr[] = { 4, 5, 10, 3 };
arr[0] = 7;
arr[2] = arr[1] * arr[3];
arr values are now ( , , , ).
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