Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA CODE (THREADS) Java Threads Develop a thread call it MyThread that has one property the name and the run method. The run method should

JAVA CODE (THREADS)
image text in transcribed
Java Threads Develop a thread call it MyThread that has one property the name and the run method. The run method should print the thread name and the current time for 3 times. Write the main function to create 10 threads, given them the names from Thread1 to Thread10, run them all and wait till they all finished. A sample run is given below: Thread Non Teb IS 00:59:51 GST 9021 Theedo 1o Peb 15 00:65:62 GST Threadlo Mon Feb 15 00:59:55 GST 300 Threadlo - Mon Feb 16 00:59:51 GST 2001 Thread: Mon Teb 15 00:53:51 GST 2021 Thread: Won Teb 18 00:09:01 GST 2021 Thread Hon Feb 15 00:59:51 ST 3031 Thread Mon Tel 15 00:55:62 GST 20L Thread : Mon Teb 15 00:55:52 GST 9021 Thread Hon Teb 15 00:13:51 GST 2021 Threads Montes IS 00:59:51 GST 2021 Theed Mon Feb 18 00:59.61 87 2001 Thread Won T IS 00:59:53 GST 9021 Thread: Mon Teb IS 00:55:51 GST 2021 Thread: Mon Teb 15 00:35:62 GST 2021 Threads Hon Feb 18 00:09.61 2022 Thread Mon Feb 15 00:59:53 GST 9001 The ads Mon Teb IS 00:55 GST 2021 Thread: Mon Ted LS 00:03:51 GST 2021 Thesd. Monteb 15 DO 03:51 GST 2021 Theead? Mon reb Ls 00:89.51 cT 2021 The Hor Teb 16.00 89:62 ST 301 Thread Non Feb 15 00:53:62 GST 3021 Thread: Mon Tab IS 00:59:51 GST 2021 Thesda . Henteb 15 00:59:01 GST 3021 Threads: Hon Veb 18 00:89:61 87 2022 The Mon Feb 15 00:59:53 GST 9001 Thread: Mon Teb 16 00:55:62 GST 2001 Thread: Mon Teb 15 00:05:53 GST 9021 ThreadaMonteb 18 00:03:51 GST 302

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions