Results 1 to 4 of 4

Thread: Sizing an Array parameter.

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Sizing an Array parameter.

    Im using enumerate(Thread[] t) to get a count of all the active Threads that I have running within my program. Problem is that even though I know how many threads that I spawn within my prog I am sure that there are times when the amount of active Threads is not know. So how does one know how large to make the Array? ThreadGroup has activeCount() which returns all active threads but this requires an instance of a ThreadGroup.

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Sizing an Array parameter.

    Is there some possible way to integrate into an "anonymous" array?

    Such as this:

    String[] days = new String[] {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"};

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: Sizing an Array parameter.

    Call Thread.currentThread().getThreadGroup()
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Re: Sizing an Array parameter.

    That's CornedBee that's exactaly what I was looking for. Thanks also System_Error. Help is always greatly appreciated.

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