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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!