i take from a file elements with readLine( ) and i want to sort them ignoring cases (they are words) and put them in a vector (not array).
From staykovmarin's posts:
BufferedReader reader = new BufferedReader(new FileReader("test.txt"));
Vector<String> v = new Vector<String>();
String line;
while ((line = reader.readLine()) != null) {
v.add(line);
}
what should I do? add them in the vector with .add() and then rearrange them and put them in a new vector? and how?
Vector implements the List interface which implements the Collection interface. Therefore you can use the Collections class to sort your Vector with a comparator that sorts the words with/in lower case. See the Comparator api. And see the "Sorting" section on this page
Lesson: Algorithms in the Collections trail.
Collections.sort(v, your_Comparator);
is this situation suitable for a stack use
Maybe; depends on what you want to do.