Question: 1-With an array defined as: int[] array1 = new int[5]; a. Write the example top line of a for loop that will access every element.
1-With an array defined as: int[] array1 = new int[5];
a. Write the example top line of a for loop that will access every element.
b. Write the example top line of a for each loop that access every element.
c. Write an example for limit similar to item a, but access the elements in reverse order.
2.-For a two-dimensional integer array named array3:
a.Write the definition and initialization lines that will assign it space for 3 rows and 5 columns; b. Write two nested for loops in order to access every element. Include a variable within the inner loop that is assigned the current element. c. What is the value of array3.Length.
3-.For the ArrayList named arrayList4:
A. Create the definition code for the variable. B. Add a string containing Your name to the array list. C. Pretend there are dozens of items in the list and remove the 5th one. D. Pretend there are dozens of items in the list and write the code to find the location of the string Question4d. E. Create a second array list and assign it as a copy of arrayList4.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
