Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22
  1. #21
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    14,793
    Rep Power
    20

    Default

    If you only want to look at what is currently in paths.
    Java Code:
    for(int i=0; i < paths.size(); i++)
    vs
    Java Code:
    int pathsSize = paths.size();  // get current size. size() will change if we add to the list
    for(int i=0; i < pathsSize; i++)

  2. #22
    Ciwan's Avatar
    Ciwan is offline Member
    Join Date
    Dec 2008
    Location
    Earth
    Posts
    88
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    int pathsSize = paths.size(); // get current size. size() will change if we add to the list
    for(int i=0; i < pathsSize; i++)
    Genius !! Thank You
    >> What can be asserted without proof can be dismissed without proof. <<

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Stack to an ArrayList<String>
    By Ciwan in forum New To Java
    Replies: 5
    Last Post: 05-22-2011, 08:00 PM
  2. Stack (collection) to int via String
    By aborgeld in forum New To Java
    Replies: 7
    Last Post: 04-07-2011, 05:16 PM
  3. Replies: 12
    Last Post: 11-26-2010, 08:33 AM
  4. Replies: 1
    Last Post: 11-04-2010, 06:53 PM
  5. Question regarding foreach loop...
    By theonlywalks in forum New To Java
    Replies: 2
    Last Post: 03-15-2008, 06:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •