Solved

Java vector or array for string sorting

Posted on 2009-04-14
3
294 Views
Last Modified: 2013-11-23
Given vector or array to store strings, which one allows sorting?
Please advise how.
Thanks.
0
Comment
Question by:ksfok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 24144706
both do. Vector is synchronized while ArrayList is not.
So use ArrayList where only single thread access, asi its faster

0
 
LVL 4

Assisted Solution

by:aman123_123
aman123_123 earned 200 total points
ID: 24144713
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
 
LVL 1

Assisted Solution

by:isarasoo
isarasoo earned 100 total points
ID: 24147144
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jsp login check 12 52
collection output issue 9 59
java mysql insert application 14 41
Find out all repos that a user is most active on Github 1 27
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question