SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'Runnable' Objects inside ArrayList..

    Hi All,

    I have 'Runnable' Objects (B) inside an ArrayList declared of type A (Non runnable).

    At some point in the program I have to create Threads from the contents of the Array List, and although the contents are indeed runnable, the array list is not declared as a runable type. (I do hope that made sense).

    Whene I pass each of the Objects (B) contained in the array list to the constructor of Thread, Java reports that it does not recognise this is valid.

    I am assuming this is down to the fact that the arrayList (A) is declared of a non-runable type, regardless of the fact that its contents (B) are.

    How can I get Thread to accept the objects inside arrayList as runable?

    Many thanks for your help

  2. #2
    SiteP0int Weazle hooknc's Avatar
    Join Date
    Dec 2004
    Location
    Socialist Republic of Boulder
    Posts
    937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have a small piece of sample code we could look take a look at?
    baby steps... baby steps...


Bookmarks

Posting Permissions

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