Results 1 to 6 of 6
  1. #1
    starwars is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default Finding objects in a list

    I have a list of functions like {fn1,fn2,fn3,fn4,fn5,fn1,fn3}

    I have to change it to {fn1,fn2,fn3,fn4,fn5,fn1_1,fn3_1} which means, I have to find the second occurence and rename them

    Pls help

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    What have you done so far?

  3. #3
    starwars is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default

    I read out the first object in the list, and put it into a loop checking through the whole list.

    Is that the right approach?

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    What type are these objects? You called them functions above. Is there a function class somewhere?
    Are the fn1, fn2 e.t.c a String attribute in the Function class?

  5. #5
    starwars is offline Member
    Join Date
    Sep 2009
    Posts
    3
    Rep Power
    0

    Default

    The names of funtions (fn1, fn2....) are strings in a Jlist

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    So yeah go ahead and give it a stab. Post if you get problems with your code.

Similar Threads

  1. List of objects
    By bubbless in forum New To Java
    Replies: 0
    Last Post: 08-01-2009, 04:21 PM
  2. List of objects
    By rekha in forum New To Java
    Replies: 6
    Last Post: 03-20-2009, 11:39 AM
  3. Replies: 5
    Last Post: 02-07-2009, 07:48 AM
  4. Replies: 1
    Last Post: 01-22-2009, 04:25 PM
  5. Getting objects from a list
    By markyoung1984 in forum New To Java
    Replies: 4
    Last Post: 03-13-2008, 10:45 PM

Posting Permissions

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