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 <[email protected]>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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
