Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Increasing the numerical suffix of a variable

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Increasing the numerical suffix of a variable

    I have an XML file and I am reading the XML file using DOM and getting the tag values. I want to increase the indent of the variable to feed the commands and then I need to store them in an array

    Element eElement = (Element) nNode;
    String COMMAND1 = null;
    COMMAND1 = getTagValue("DS_DESCRIPTION", eElement);

    I want to enter the commands in COMMAND1, COMMAND2 ...........and proceeding till I have entered all the commands in COMMAND variable


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Increasing the numerical suffix of a variable

    You could put the values into an array or use a Map. You can not create variable names when the program executes.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Increasing or decreasing!
    By pesha in forum Algorithms & Recursion
    Replies: 4
    Last Post: November 6th, 2011, 04:06 PM
  2. numerical conversion methods..
    By Neo in forum Algorithms & Recursion
    Replies: 1
    Last Post: February 17th, 2011, 11:51 PM
  3. Applets progress bar not increasing
    By Edvinauskas in forum Java Servlet
    Replies: 8
    Last Post: November 22nd, 2010, 07:04 PM
  4. [SOLVED] Method of Sorting? by assiging numerical values to Strings
    By Mirage in forum Java Theory & Questions
    Replies: 0
    Last Post: June 16th, 2010, 07:49 PM
  5. numerical conversion methods..
    By chronoz13 in forum Java SE APIs
    Replies: 12
    Last Post: September 27th, 2009, 04:29 AM