title: Read one line at time from a file when a function is called each time
body: <pre><code>String time=Read_one_Line();
  
  public static String Read_one_Line() throws FileNotFoundException, IOException
  {
  
    FileInputStream fin=new FileInputStream("sample.txt");
  
    BufferedReader br=new BufferedReader(new InputStreamReader(fin));
  
    str=br.readLine();
  
    next_line=br.readLine();
  
    return next_line;
  }
  </code></pre>
  
  <p><strong>Each time it should read one line from text file</strong> called <strong>"sample.txt"</strong> and <strong>return it</strong>. next time it should return next line and so on....</p>
  
  <p><strong>Contents of sample.txt are:</strong></p>
  
  <pre><code>Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:310
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:0
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:10
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:0
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:380
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:10  MilliSeconds:-840
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:0
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:0
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:0
  
  Date:0   Year:0  Hour:0  Minute:0    Seconds:0   MilliSeconds:0
  </code></pre>
  
  <p>But rather its reading and returning first line only each time.. please tell me how to increment to next line and return it when i call this function next time.</p>