Question: Declare a ArrayList data structure to hold 15 randomly generated integers between 1 and 50 (repetition is allowed). Print the contents of the ArrayList to

Declare a ArrayList data structure to hold 15 randomly generated integers between 1 and 50 (repetition is allowed).

Print the contents of the ArrayList to the screen.

Write a method to sort the ArrayList in Ascending order. The Method will take an ArrayList as a parameter to be sorted. No sorting routine is allowed(i.e. you cannot use Collections.sort. etc.) Call this method in the main method, passing it your original ArrayList

Print the sorted ArrayList to the screen.

Public static void sorting(ArrayList n) {

//code here

}

Public static void main (String[] args) {

//Call above method here, passing in your ArrayList as a parameter

}

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!