Okay, we are just learning how to read in from a file and I'm having trouble with what seems like the easiest part. I need to sort my ArrayList full of objects which are "Shapes" by name first, and then by the size of their area. The name one is giving me the most trouble now because I'm not really sure how to compare strings. The Shape's names are as follows shape1,shape2,shape3,shape4,.....shape252. They are read in as are on the txt file (in a random order) and now need to be sorted by name. I have methods which can return a string of said shape's name , but how do I go about comparing "shape15" vs "shape5" obviously shape 5 should go first in this situation.
I would like to avoid the many "OH DIS EASY JUST IMPLEMENT COMPAREABLE BLAH BLAH" can't do that for this assignment it basically has to be our own algorithm.
as far as area goes I think I'll be able to just compare the returned values of the shape's area and just sort them in that order. numbers always seem to make sense, so I just need a little help with the String.