0% found this document useful (0 votes)
12 views7 pages

How To Create Threads in Java by Deepak Smart Programming Lyst2767

The document provides a guide on creating threads in Java using the 'Thread' class, outlining the steps involved including inheriting the class, overriding the run() method, and starting the thread. It explains the purpose of the start() method, which registers the thread with the scheduler and invokes the run() method. Additionally, it includes diagrams illustrating the flow of threads and their execution processes.

Uploaded by

Aakash Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

How To Create Threads in Java by Deepak Smart Programming Lyst2767

The document provides a guide on creating threads in Java using the 'Thread' class, outlining the steps involved including inheriting the class, overriding the run() method, and starting the thread. It explains the purpose of the start() method, which registers the thread with the scheduler and invokes the run() method. Additionally, it includes diagrams illustrating the flow of threads and their execution processes.

Uploaded by

Aakash Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Smart Programming : Channel

An investment in Knowledge pays the best interest….

Creating Threads (Part 1)


in Java
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308

=> By using "Thread" class :-


-> Steps to create thread using "Thread" class :-
1. inherits the "Thread" class
2. override the run() method
3. create an instance of the class
4. start the thread

========================================
========================================

=> What is the use of start() method :-


1. It register the thread with "thread scheduler"
2. It will execute all the mentadory functionalities
related to thread
3. It will invoke the run() method
etc

1
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308

Diagrams used in the videos :-


 Diagram 1 :
(flow of simple thread)

2
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308

 Diagram 2 :
(If we don’t use thread concept then time taken
to perform task will increase)

3
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308

 Diagram 3 :
(Main thread and user thread creation and their
execution)

4
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308

 Diagram 4 :
(Which thread will execute which part)

5
Smart Programming (Mohali, Chandigarh India)
Call or Whats App Online & Industrial Training: +91 62838-30308

Company Links & Contacts

Company Name: Smart Programming (+91 62838-30308)

Address : Chandigarh & Mohali (Punjab), India

Websites: https://www.smartprogramming.in/
https://courses.smartprogramming.in

Android App:
https://play.google.com/store/apps/details?id=com.sma
rtprogramming

YouTube Channel:
https://www.youtube.com/c/SmartProgramming

You might also like