SlideShare a Scribd company logo
1 of 16
Multithreading
in
Java
1rkm
Multithreading in Java
You will Learn :
 Multiprogramming
 Multitasking
 Multithreading & Thread
 Diff between Multiprogramming & Multithreading
 Practical use of Multithreading
 Advantages
 Implementation of Multithreading in Java
 Built-in Library for Multithreading in Java
 Important methods to implement Multithreading in Java
 Program of Multithreading in Eclipse
2rkm
Multiprogramming
Multiprogramming is the ability of an operating system to execute
multiple programs at the same time on single processor machine.
If the currently executing process performs i/o operation or
waiting for i/o then the Operating System may interrupt that
process and gives the control to other process residing in main
memory.
Process 1
Process 2
i/o of P1
3rkm
The process of having a computer perform multiple tasks
simultaneously.
For example : Listening of music in background while browsing
internet or typing in MS-Word in foreground.
Multitasking
4rkm
Multithreading
It is the ability of a CPU which execute multiple
thread concurrently, supported by the operating system
Thread : A Thread is the smallest
sequence of programmed
instructions that can be managed
independently.
Threads are independent because
they all have separate path of
execution that’s the reason if an
exception occurs in one thread, it
doesn’t affect the execution of
other threads.
5rkm
Objective of Multithreading:
•To increase utilization of a single core by using Thread-level parallelism, as well
as Instruction-level parallelism.
Difference between Process and Thread :
•Process means any program is in execution while thread is a segment of the process.
•Every process uses separate memory while all the threads use shared memory.
Multithreading
6rkm
While you are typing on Ms-Word spell check checking spelling
and informed to user about the spelling mistake. Spell check
working as a Thread.
Practical use of Thread
7rkm
User
•When you insert ATM card into ATM Machine it start a new thread to
perform your request. There are multiple account holders on the same
server requesting the server simultaneously. Server software create a
new thread for every user.
•Railway reservation system where multiple users accessing the same
server.
Practical use of Thread
Server
8rkm
•When you request to Amazon server from your mobile
through Amazon App, that request become a thread and
your Mobile Application doing another task when request
is forward in the form of thread.
Practical use of Thread
9rkm
In multimedia games you can use multiple objects like
human, gun etc. These objects are nothing but the
threads.
Practical use of Thread
10rkm
Advantages of Multithreading
•Threads are independent so users are not blocked and we
can perform multiple operations at times.
•The other threads won't get affected if one thread meets an
exception.
•Multiple threads don't allocate separate memory area, hence they
save memory.
•In Multithreading context switching between threads takes less
time.
11rkm
Implementation of Threads in Java
Thread Life Cycle in Java
12rkm
•New: The thread is created using class "Thread class". It remains in this
state till the program starts the thread. It is also known as born thread.
•Runnable: The instance of the thread is invoked with a start method.
The thread control is given to scheduler to finish the execution. It
depends on the scheduler, whether to run the thread.
•Running: The scheduler selects one thread from the thread pool, and it
starts executing in the application.
•Waiting: This is the state when a thread has to wait. As there multiple
threads are running in the application, there is a need for synchronization
between threads. Hence, one thread has to wait, till the other thread gets
executed. Therefore, this state is referred as waiting state.
•Dead: This is the state when the thread is terminated. The thread is in
running state and as soon as it completed processing it is in "dead
state".
Thread Life Cycle in Java (Stages)
13rkm
Built-in Library of Java for Thread
Built-in Class : Thread
Built-in Interface : Runnable
Package for both : java.lang
(java.lang is default package of Java so it
is no need to import explicitly. )
14rkm
Important Methods of Java Thread Class
void start() : It use to start the execution of thread. It call the run()
method defined to do some action in thread.
void run() : It used to define an action for thread.
static void sleep() : It sleeps a thread for specified time or a thread enter in
wait state for a specified time.
void stop(): It used to stop a thread.
void destroy() : It used to destroy the thread.
void suspend() : It used to suspend the thread.
void resume() : It resume the suspended thread.
static yield(): It pause the currently executing thread and allow other
thread to execute temporarily.
15rkm
Practical Program on Eclipse
16rkm

More Related Content

What's hot (19)

Java Threads
Java ThreadsJava Threads
Java Threads
 
Thread
ThreadThread
Thread
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Java thread life cycle
Java thread life cycleJava thread life cycle
Java thread life cycle
 
Multi-threaded Programming in JAVA
Multi-threaded Programming in JAVAMulti-threaded Programming in JAVA
Multi-threaded Programming in JAVA
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Threads and multi threading
Threads and multi threadingThreads and multi threading
Threads and multi threading
 
Java threads
Java threadsJava threads
Java threads
 
Networking threads
Networking threadsNetworking threads
Networking threads
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
 
Threading in C#
Threading in C#Threading in C#
Threading in C#
 
Threads concept in java
Threads concept in javaThreads concept in java
Threads concept in java
 
Multi-Threading
Multi-ThreadingMulti-Threading
Multi-Threading
 
Java Multithreading
Java MultithreadingJava Multithreading
Java Multithreading
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
 

Similar to Introduction to Multithreading in Java

8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptxsandhyakiran10
 
Multithreading programming in java
Multithreading programming in javaMultithreading programming in java
Multithreading programming in javaElizabeth alexander
 
Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight ProcessesIsuru Perera
 
Multithreading
MultithreadingMultithreading
MultithreadingF K
 
Java multithreading
Java multithreadingJava multithreading
Java multithreadingMohammed625
 
Unit-3 MULTITHREADING-2.pdf
Unit-3 MULTITHREADING-2.pdfUnit-3 MULTITHREADING-2.pdf
Unit-3 MULTITHREADING-2.pdfGouthamSoma1
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaKavitha713564
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaKavitha713564
 
Lec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented ProgrammingLec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented ProgrammingBadar Waseer
 
Lecture 23-24.pptx
Lecture 23-24.pptxLecture 23-24.pptx
Lecture 23-24.pptxtalha ijaz
 
U4 JAVA.pptx
U4 JAVA.pptxU4 JAVA.pptx
U4 JAVA.pptxmadan r
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaRaghu nath
 
Multithreading in Scala
Multithreading in Scala Multithreading in Scala
Multithreading in Scala Knoldus Inc.
 

Similar to Introduction to Multithreading in Java (20)

8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
8.-OBJECT-ORIENTED-PROGRAMMING-USING-JAVA-Multithreading.pptx
 
Multithreading programming in java
Multithreading programming in javaMultithreading programming in java
Multithreading programming in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight Processes
 
multithreading
multithreadingmultithreading
multithreading
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Slide 7 Thread-1.pptx
Slide 7 Thread-1.pptxSlide 7 Thread-1.pptx
Slide 7 Thread-1.pptx
 
Java multithreading
Java multithreadingJava multithreading
Java multithreading
 
Java threading
Java threadingJava threading
Java threading
 
Unit-3 MULTITHREADING-2.pdf
Unit-3 MULTITHREADING-2.pdfUnit-3 MULTITHREADING-2.pdf
Unit-3 MULTITHREADING-2.pdf
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
Lec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented ProgrammingLec 1.10 Object Oriented Programming
Lec 1.10 Object Oriented Programming
 
Lecture 23-24.pptx
Lecture 23-24.pptxLecture 23-24.pptx
Lecture 23-24.pptx
 
U4 JAVA.pptx
U4 JAVA.pptxU4 JAVA.pptx
U4 JAVA.pptx
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading in Scala
Multithreading in Scala Multithreading in Scala
Multithreading in Scala
 

Recently uploaded

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 

Recently uploaded (20)

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

Introduction to Multithreading in Java

  • 2. Multithreading in Java You will Learn :  Multiprogramming  Multitasking  Multithreading & Thread  Diff between Multiprogramming & Multithreading  Practical use of Multithreading  Advantages  Implementation of Multithreading in Java  Built-in Library for Multithreading in Java  Important methods to implement Multithreading in Java  Program of Multithreading in Eclipse 2rkm
  • 3. Multiprogramming Multiprogramming is the ability of an operating system to execute multiple programs at the same time on single processor machine. If the currently executing process performs i/o operation or waiting for i/o then the Operating System may interrupt that process and gives the control to other process residing in main memory. Process 1 Process 2 i/o of P1 3rkm
  • 4. The process of having a computer perform multiple tasks simultaneously. For example : Listening of music in background while browsing internet or typing in MS-Word in foreground. Multitasking 4rkm
  • 5. Multithreading It is the ability of a CPU which execute multiple thread concurrently, supported by the operating system Thread : A Thread is the smallest sequence of programmed instructions that can be managed independently. Threads are independent because they all have separate path of execution that’s the reason if an exception occurs in one thread, it doesn’t affect the execution of other threads. 5rkm
  • 6. Objective of Multithreading: •To increase utilization of a single core by using Thread-level parallelism, as well as Instruction-level parallelism. Difference between Process and Thread : •Process means any program is in execution while thread is a segment of the process. •Every process uses separate memory while all the threads use shared memory. Multithreading 6rkm
  • 7. While you are typing on Ms-Word spell check checking spelling and informed to user about the spelling mistake. Spell check working as a Thread. Practical use of Thread 7rkm
  • 8. User •When you insert ATM card into ATM Machine it start a new thread to perform your request. There are multiple account holders on the same server requesting the server simultaneously. Server software create a new thread for every user. •Railway reservation system where multiple users accessing the same server. Practical use of Thread Server 8rkm
  • 9. •When you request to Amazon server from your mobile through Amazon App, that request become a thread and your Mobile Application doing another task when request is forward in the form of thread. Practical use of Thread 9rkm
  • 10. In multimedia games you can use multiple objects like human, gun etc. These objects are nothing but the threads. Practical use of Thread 10rkm
  • 11. Advantages of Multithreading •Threads are independent so users are not blocked and we can perform multiple operations at times. •The other threads won't get affected if one thread meets an exception. •Multiple threads don't allocate separate memory area, hence they save memory. •In Multithreading context switching between threads takes less time. 11rkm
  • 12. Implementation of Threads in Java Thread Life Cycle in Java 12rkm
  • 13. •New: The thread is created using class "Thread class". It remains in this state till the program starts the thread. It is also known as born thread. •Runnable: The instance of the thread is invoked with a start method. The thread control is given to scheduler to finish the execution. It depends on the scheduler, whether to run the thread. •Running: The scheduler selects one thread from the thread pool, and it starts executing in the application. •Waiting: This is the state when a thread has to wait. As there multiple threads are running in the application, there is a need for synchronization between threads. Hence, one thread has to wait, till the other thread gets executed. Therefore, this state is referred as waiting state. •Dead: This is the state when the thread is terminated. The thread is in running state and as soon as it completed processing it is in "dead state". Thread Life Cycle in Java (Stages) 13rkm
  • 14. Built-in Library of Java for Thread Built-in Class : Thread Built-in Interface : Runnable Package for both : java.lang (java.lang is default package of Java so it is no need to import explicitly. ) 14rkm
  • 15. Important Methods of Java Thread Class void start() : It use to start the execution of thread. It call the run() method defined to do some action in thread. void run() : It used to define an action for thread. static void sleep() : It sleeps a thread for specified time or a thread enter in wait state for a specified time. void stop(): It used to stop a thread. void destroy() : It used to destroy the thread. void suspend() : It used to suspend the thread. void resume() : It resume the suspended thread. static yield(): It pause the currently executing thread and allow other thread to execute temporarily. 15rkm
  • 16. Practical Program on Eclipse 16rkm