public class SieveDemo {
   public static void main (String [] args) {
      int colcounter=0;
   
      Counter c = new Counter(2);    // initialize the Counter c at 2
      Sieve s = new Sieve(c);       // initialize the Sieve s's source to c
      int next;
      do {
         next = s.out();            // get the next prime
         System.out.format("%5d ", next);  // and print it
         if ((++colcounter)%10==0)
           System.out.println();
      } while (next < 10000);   
      System.out.println();
   }
}
