I need a way of putting a fraction into an ArrayList
. I am having problems however because I'm not sure how I could do this in a way that I could later compare them so they can be sorted.
Note: I will be using 4 or more fractions and I'm not too sure how to (if its possible) to use the comparable class to do it for more than 2.
For example: I need to input 1/1 , 3/4 , 7/4 , 2/8
I then need to sort them (Using the list) from the smallest to the greatest.
Any help is appreciated.