title: How to "reset" iteration through an Enumeration list
body: <pre><code>Enumeration&lt;NetworkInterface&gt; nets
          = NetworkInterface.getNetworkInterfaces();
  
  out.print("List of all network interfaces on this machine:\n");
  
  for (NetworkInterface netint : Collections.list(nets)) {
      out.printf("name:%s (%s)\n", netint.getName(), netint.getDisplayName());
  }
  </code></pre>
  
  <p>I'm doing an assignment that requires me to list a bunch of information using NetworkInterface, but I'm not very familiar with Enumeration, so I'm having trouble.</p>
  
  <p>I went through some javadocs and managed to get this far. The problem is that I need to be able to go through the list multiple times.</p>
  
  <p>For example, I was wanting to use another for loop to cycle through and list all interfaces that were currently up.</p>
  
  <p>Something like this:</p>
  
  <pre><code>for (NetworkInterface netint : Collections.list(nets)) {
      if (netint.isUp()) {
         out.printf("name:%s (%s)\n", netint.getName(), netint.getDisplayName());
      }
  }
  </code></pre>
  
  <p>However, any time I use a for loop after the first one I'm not getting any output. I have a feeling this has to do with my lack of understanding. I can't seem to find an explanation anywhere.</p>