and what about searching inside the records fields ,does ArrayList is the best solution ? knowing that the toString() methods includes many fiels (name,last name,..etc )here is my code ,thanks everybody for any help....
Expand|Select|Wrap|Line Numbers
- public void writeToFile(String filename){
- try {
- String fileName = "myFile.txt";
- BufferedWriter out = new BufferedWriter(new FileWriter(fileName, true));
- out.write(toString() + "\n");
- out.flush();
- out.newLine();
- out.close();
- }
- catch (Exception e) {
- System.out.println("IOException:");
- e.printStackTrace();
- }
- }
- }