array of objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Psybar Phreak

    array of objects

    hi all,

    i have an array of objects, and i can get each object out, but what i want,
    is to get the value of a variable from that object that ive pulled out of
    the array.

    how?

    thanks

    PP


  • Psybar Phreak

    #2
    Re: array of objects

    dont worry.

    i got it =)

    PP


    "Psybar Phreak" <psybar_phreak@ yahoo.com> wrote in message
    news:3f79786d$0 $26924$afc38c87 @news.optusnet. com.au...[color=blue]
    > hi all,
    >
    > i have an array of objects, and i can get each object out, but what i[/color]
    want,[color=blue]
    > is to get the value of a variable from that object that ive pulled out of
    > the array.
    >
    > how?
    >
    > thanks
    >
    > PP
    >
    >[/color]


    Comment

    • fozzy

      #3
      Re: array of objects

      Psybar Phreak wrote:
      [color=blue]
      > hi all,
      >
      > i have an array of objects, and i can get each object out, but what i want,
      > is to get the value of a variable from that object that ive pulled out of
      > the array.[/color]

      Cast the object to the object supposed to be pulled out. Now you can
      retreive the value:

      myVar = ((myClass)objec tArray[i]).getTheVar();


      --
      len

      Comment

      Working...