Question: 1. DeclareAndInitialize Method (a) Declare an array with n elements (where n is the integer parameter for this method) and initialize the array with numbers


1. DeclareAndInitialize Method (a) Declare an array with n elements (where n is the integer parameter for this method) and initialize the array with numbers n through 1 in descending order (n, n-1, ... , 2, 1). (b) Create an ArrayList with n elements, n through 1, in descending order. 2. Set To42 Method (a) Change the method signature so that it takes in an integer array. (Do not include any other parameters) (b) Set the last integer in that array to 42. (c) Change the method signature again so that the method returns an integer array. (d) Return the array that has 42 as the last integer. 3. Set To 24 Method (a) Change the method signature so that it takes in an ArrayList. (Do not include any other parameters) (b) Change the value of the oth element in that ArrayList to 24. (c) Change the method signature again so that the method returns an ArrayList. (d) Then return the ArrayList that has 24 as the oth element 1. Print Method Change the method signature so that it takes in an Array AND an ArrayList, then print out both one after the other
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
