Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

#86 Multiple Threads in Java

281.2K views on YouTube

Check out our courses:

Agentic AI Engineering with Python : https://go.telusko.com/agentic-ai-python
Coupon: TELUSKO10 (10% Discount)

Master Java Spring Development : https://go.telusko.com/learn-master
Coupon: TELUSKO10 (10% Discount)

For More Queries WhatsApp or Call on : +919008963671

website : https://telusko.com/

Udemy Courses:

Java Spring:- https://go.telusko.com/Udemyjavaspring
Java:- https://go.telusko.com/udemyteluskojava
Spring: https://go.telusko.com/udemyteluskospring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopython
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodocker

Instagram : https://www.instagram.com/navinreddyofficial/
Linkedin : https://in.linkedin.com/in/navinreddy20
WhatsApp : https://go.telusko.com/whatsapp
Discord : https://discord.gg/D8hWe9BqfF

In this lecture we will learn:
– Multiple Threads in Java
– How to create a thread?
– How we can do parallel programming?
– start() and run() methods in multithreading
– Time-sharing between multiple threads

#1
When you build an application, we use certain frameworks and behind the scene, these frameworks will create threads.
– Every statement runs in a sequence in the main method.
– If you want to execute two behaviours to execute at the same time, then we can use threads.
– We can not execute normal objects in multiple threads or normal objects can not be executed simultaneously.

#2
– Java provides a Thread class to achieve thread programming. The thread class provides constructors and methods to create and perform operations on a thread.
– A thread can be created by extending the thread class. The thread class can be extended through the Thread keyword.
– By using the Thread keyword with class, it will not create a new thread.

#3
– We have to use the start() method in the main to start the execution of a new thread.
– start() is a method that is present inside the thread class. start() method only calls the run method.
– Start() invokes the run() method on the Thread object.
– run method should be present inside every thread to start a new thread.
– run() method is used to do an action for a thread.

#4
– All threads cannot run at the same time, so threads go for the time sharing.
-In this time-sharing Operating system, many processes are allocated with computer resources in respective time slots.
– Scheduler is responsible to allow which thread to execute at what time.

Github repo : https://github.com/navinreddy20/Javacode.git

More Learning :

Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6

JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq

Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA

Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB

NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L

Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20