I'm posting here because I close my previous question (http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21400413.html
) too quick (the answer helped me understanding my mistake, but now I have a logic problem).
I have a class named Dictionnary with a vectors containing a list of words: "protected Vector mots;"
I created a new class in a different file name "Cruciverbist" which is declared like this: "public class Cruciverbiste extends Dictionnaire"
Now what I want to do is:
- First to declare an array that can contains 24 vectors of words.
- Then, make a constructor that receive a filename of a file containing the list of words.
- Finaly, separate the dictionnary' words depending of their length, putting them in different vectors of the vectors' array.
* There should be a vector for each length of word (2 to 25 letters by word) containing every words of this length.
Here's how I started:
public class Cruciverbist extends Dictionnary
// First point. How do you declare an array of vectors ? It needs to have 24 elements, but I don't know how to initialize it with these elements... I need to
declare a new vector and add empty items ?
public Cruciverbist (String filename) throws IOException
// I'd like to create a new Dictionnary with the filename passed in parameter.
// Then I'll have to read each words of the "words" vector and add them in the different vectors of the array.
public class Dictionnary
protected Vector words;
public Dictionnary(String filename) throws IOException
quickSort(words, 0, words.size() - 1);
I would really appreciate if anyone could help me with this one. Thanks