8 Replies Latest reply on Jun 28, 2007 6:11 AM by Aspar

    Iterator Class vs For Loops?

    cayennecode Level 1
      I'm reading about some users using custom Iterator classes with while loops as such.

      while(iterator.hasNext())
      {
      do something special();
      }

      I'm just wondering what performance differences there might be between such a style, and using a simply for loop. Anyone have concrete info?

      foreach (var i in Collection) {
      do something special();
      }