Results 1 to 3 of 3

Thread: Array list of Objects

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    12

    Array list of Objects

    Code:
      for(int i=0;i<TERMS.size();i++)
      {
          if(TERMS[i].operator.equals("*"))
          {  
             TERMS[i-1].value*= TERMS[i].value;
             TERMS[i].value = 0;
             TERMS[i].operator = "+";
             
             if(TERMS[i].Type.equals("x")) TERMS[i-1].Type = "x";
             
             i = 0;
           }
      }
    TERMS is an array list filled with "Term" objects. i don't understand why this doesn't work...this is my first time using arrayList and i don't really know much about it

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Array list of Objects

    Then read more about the ArrayList Class. Always use the JavaDocs
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    12

    Re: Array list of Objects

    Thanks my friend, the link helped a bunch

Posting Permissions

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



Click Here to Expand Forum to Full Width