Check the collections API, there are some sorted implementations you can use.
No sorted List is provided but it isn't that hard to make one if you use another collection to back it which is sorted itself (or use that one directly if you have no need of the List interface per se).
And before I forget: don't use Vector. It's an old relic and has long since been replaced by the far more efficient ArrayList.
I actually used a SortedSet which seems to have done the job nicely. Thanks for the tip on Vectors, i see they have synchronisation overhead - what other problems have you found with them. I couldn't find a clear explanation. Thanks again guys :)
The performance penalty alone is enough reason.
The rest is historical. Until recently Vector was not part of the Collections framework. It still is an oddball with regard to implementing methods of the framework.
Personally I don't understand why Sun didn't just deprecate the class seeing as a perfectly functional alternative is available.
ArrayList is a far cleaner as well as better performant solution.
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...