System.out.println("");
i have a text file called "dictionaryA.txt", which i want to read into this array instead, how can i do this ?
or better still, can you please help me edit this method appropriately to implement the change?
Expand|Select|Wrap|Line Numbers
- public static class Tree<T>
- {
- public void traverse(TreeNode p)
- {
- System.out.println(p.data);
- List list = new List();
- //if(relationship() == 1)
- String[] arrayA = {"and","ant", "aeroplane", "apple", "augustine"};
- System.out.println("");
- if(p.data.equals('A'))
- {
- for(int i=0; i < arrayA.length; i++)
- {
- list.add(i, arrayA[i]);
- System.out.println(arrayA[i]);
- }
- }
- //else
- {
- if(p.firstChild != null)
- traverse(p.firstChild);
- if(p.nextSibbling != null)
- traverse(p.nextSibbling);
- }
- }
- }