Professional Documents
Culture Documents
Threading - Java
Threading - Java
Day 6 - morning
5. Terminated - It has completed the run() method and reached the end of life.
4/30/2024 Dr. Randima Dinalankara 3
Implement a simple thread
The output of the programme would print the letter ‘A’ and ‘B’
interchangable manner.
• In general, the priority value for all the threads are set at 5.
• So all the threads have the same priority.
• Syntax
– <Thread name>.getPriority()
System.out.println(count);
count++;
System.out.println(count);
}