Originally Posted by
javapenguin
Is an OrderedArrayList an ArrayList that implements comparable and can be in order, like numeric or alphabetic order? I've been wondering if there was such a class.
Yes, my ArrayOrderedList uses the comparable interface to add item in the array according to their ID's (account number int his case)
Originally Posted by
helloworld922
Generally, it's not a good idea to subclass an ArrayList. Arrays (and in fact all lists) should by default be ordered (not necessarily in the order you want, but they are order non-the-less).
If you have no get method (or some other similar method), then you cannot retrieve elements from your ArrayOrderedList.
I see, but for my assignment I must do this, as per instruction from my professor
Originally Posted by
copeg
If ArrayOrderedList is a subclass of ArrayList, get is defined in the parent class ArrayList (technically defined in the List interface). Second helloworlds advice regarding extending ArrayList...not sure why you want to do this.
In my programmer defined ArrayOrderedList and ArrayList no get is defined, that is why I was having these problems. I will try and implement a get method now.