This Java program demonstrates how to create and rename threads. It defines a class 'ThreadNaming' that extends the Thread class and overrides the run() method to print a message when the thread is running. The main class 'ThreadEx' creates two threads, prints their default names, starts them, changes their names, and then prints the new names.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views1 page
Docu 3
This Java program demonstrates how to create and rename threads. It defines a class 'ThreadNaming' that extends the Thread class and overrides the run() method to print a message when the thread is running. The main class 'ThreadEx' creates two threads, prints their default names, starts them, changes their names, and then prints the new names.