Make ArrayList that holds an unspecified number of objects. The object class should be created by you
Fantastic news! We've Found the answer you've been seeking!
Question:
- Make ArrayList that holds an unspecified number of objects. The object class should be created by you in a separate file. Make a new class for this assignment- don't use a previous class.
- Your object class should be Comparable. Here's a quick tutorial on Comparable objects.(Links to an external site.) This will allow you to compare the objects using a compareTo method. It should also contain a toString method for ease of printing, an equals method, and any necessary accessors and modifiers.
- The objects should be added to the list in random order using whatever method you choose.
- Use a Merge Sort to sort the list (the code is easy to find in our books or online). The merge sort should be commented extensively to demonstrate your understanding of the algorithm. Do not use the Collections.sort() method.
- Print the list both before and after the sort.
MAKE AS SIMPLE AS POSSIBLE
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: