if u are extending Thread class, then u can simply make a new object of the
class(that is extending thread) and you will get new instance for every
thread.

if u are implementing an interface, then when u create a thread object by
Thread t=new Thread(object); and pass a different object (implementing
runnable interface) everytime u create a new Thread.

On Thu, Oct 18, 2012 at 11:04 AM, shruthi sharma
<shruthi.shar...@gmail.com>wrote:

> How can i create a new instance for every thread in java? Instead of
> reusing the same existing instance
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to