Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

Java vector or array for string sorting

Given vector or array to store strings, which one allows sorting?
Please advise how.
Thanks.
0
ksfok
Asked:
ksfok
3 Solutions
 
objectsCommented:
both do. Vector is synchronized while ArrayList is not.
So use ArrayList where only single thread access, asi its faster

0
 
aman123_123Commented:
I hope you are refering to ArrayList not array.
Both allow sorting. Sort method is provided in the utility Collections class.
As for arrays, Arrays class has the sort method.
0
 
isarasooCommented:
i thinks if you have an array you you can use the static method sort of class a as follows
Array.sort(yourarray);

just a suggestion i havent tested it. so it might not work
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now