I am using this code to read a file, when I do it with a for loop it works properly but when I use while loop it reads the first line, leaves the second line, reads the third line, and...
try { while(mybuffer.readLine() != null){ data.add(mybuffer.readLine()); System.out.println(data.elementAt(i)); i++; } } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace();} } }