hi,
for program to be concurrent i created 4 threads as below

 Thread th1 = new Thread(a1.run);
            Thread th2 = new Thread(b1.run);
            Thread th3 = new Thread(c1.run);
            Thread th4 = new Thread(d1.run );  

            th1.Start();
            th2.Start();
            th3.Start();
            th4.Start();

how do i know when the threads are finised done with the work, i print the th4 output to the consol panel and i know it is done with its work) but the program does not end

how do i end the threads?

appreciate a reply
thanks

You end a Thread by returning from the method specified in the Thread constructor.

i got it

i had to terminate the while look in the threads i created
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.