File f=new File("C:\123.txt");
BufferedReader br = new BufferedReader(new FileReader(f));
String line = br.readLine(), lastsecline= "", lastline = "";
while(line!= null){
lastsecline=lastline ;
lastline =line.trim();
line=br.readLine();
}
System.out.println("lastsecline= "+lastsecline);
System.out.println("lastline = "+lastline );