The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
February 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Rg: Thread Problem

Posted by Sriram on February 14, 2001 at 4:20 AM

> Can i create array of Thread?
> can i write this way ::::
> for(int i=0;i<3;i++)
> { t[i].start();}


-------
public class Test
{
public static void main(String args[])
{
Thread t[]=new Thread[3];
for (int i=0;i<3;i++)
{
t[i]=new Thread("name"+i);
t[i].start();
}
}
}

Hello Friend,

Check Out The Code Above. You can create an array of threads.
Feel Free To mail If There Are Any Problems.




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us