Results 1 to 3 of 3
  1. #1
    rhm54 is offline Member
    Join Date
    Jan 2008
    Posts
    12
    Rep Power
    0

    Default Increment a Variable

    Simple question,

    I have 4 variables child1, child2, child3, child4. I want to intialize the variables in a loop as such:

    Java Code:
    while(temp.getPointer() != null){
    				temp = temp.getPointer();
    				child+i = temp;
    There will not always be a child to fill every spot which is the reason I am doing it this way. Thanks in advance

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    use array !!
    dont worry newbie, we got you covered.

  3. #3
    ferranb is offline Member
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    0

    Default

    Yes, use an Array. Try to search "java array tutorial" on google.

    Ferran

Similar Threads

  1. Object ArrayList - increment solution needed badly!!
    By rugbyGeek in forum New To Java
    Replies: 4
    Last Post: 03-08-2008, 01:47 AM
  2. getting the value of variable
    By Lehane_9 in forum New To Java
    Replies: 2
    Last Post: 03-05-2008, 02:42 AM
  3. Getting variable value from a variable name
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-16-2008, 10:26 PM
  4. How to create auto-increment
    By Albert in forum JDBC
    Replies: 2
    Last Post: 07-04-2007, 06:23 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
  •