Hi, i need your help...
private static LinkedList lines = new LinkedList(); ... public static void read() throws IOException{ try { String sCurrentLine; BufferedReader br = new BufferedReader(new FileReader("forum.log")); String[] line = null; while ((sCurrentLine = br.readLine()) != null) { System.out.println(sCurrentLine); line = sCurrentLine.split(","); lines.add(line); } br.close(); lines.toArray(new String[lines.size()]); for(int i=0; i<=lines.size(); i++) System.out.println(lines.get(i)); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
In the linked list lines i want to save the words separated by "," but it gives me some exceptions and im not sure if that code does that...
Help me please
Tks


LinkBack URL
About LinkBacks
Reply With Quote