Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help. 1. DeclareAndInitialize Method (a) Declare an array with n elements (where n is the integer parameter for this method) and initialize the
I need help.
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 otherStep 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