java - Loop invariant for repeated calls to readLine() -


I have a time loop (shown below) that reads continuously with a file until it reaches the EOF is. I should write a loop irreversible for any non-trivial loop. Is this a trivial loop? If not, what would be a loop unchanging for this loop? I have never written anything irreversible before.

  while (line! = Null) {System.out.println (line); Line = reader. Readline (); } You can use a fileReader:  
   while ((line = fileReader.hasNextLine ()) = faucet {string line = fileReader.nextLine (); Println (line); }  

= D


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -