title: how to find largest and smallest primenumber in my Number.txt file?how to read the file?
body: <p>I am creating a "Numberfile.txt" and input (write) numbers and a class to find the largest and smallest prime number.</p>
  
  <p>How can I access and read the numbers, and find the largest and smallest number?</p>
  
  <pre><code>public class CheckP {
      void Check() throws IOException
      {
          Scanner s = new Scanner(new File("Numberfile.txt"));
  
          int x;
          while (s.hasNext()) 
          {   
              x(s.nextInt()); 
              boolean isPrime(int s) {
                  for(int i=2;i&lt;s;i++) {
                      if(s%i==0)
                          return false;
                  }
                  return true;
              }
          }
      }
  }
  </code></pre>
  
  <p>I want the largest and smallest number from my text file...</p>