Multithreading in Java Explained in 10 Minutes

  Рет қаралды 884,227

Coding with John

Coding with John

3 жыл бұрын

Complete Java course: codingwithjohn.thinkific.com/...
Multithreading gives you some of the coolest capabilities in Java. It's built in to the Java language.
But it can be confusing getting to learn it! Multithreading is tough to grasp at first in Java, but this beginner-friendly video will give you the ability to run simple programs in multiple threads at the same time in your Java programs.
We'll talk about 2 different ways to get your Java multithreading working, and which one I use myself.
Learn or improve your Java by watching it being coded live!
Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.
Let me know what else you'd like to see!
Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.
📕 THE best book to learn Java, Effective Java by Joshua Bloch
amzn.to/36AfdUu
📕 One of my favorite programming books, Clean Code by Robert Martin
amzn.to/3GTPVhf
🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial
www.audibletrial.com/johnclean...
🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)
bit.ly/3QPNGko
📹Phone I use for recording:
amzn.to/3HepYJu
🎙️Microphone I use (classy, I know):
amzn.to/3AYGdbz
Donate with PayPal (Thank you so much!)
www.paypal.com/donate/?hosted...
☕Complete Java course:
codingwithjohn.thinkific.com/...
codingwithjohn.com

Пікірлер: 856
@euroticker4828
@euroticker4828 2 жыл бұрын
Literally explains more than my Professor does in 6 hours, God bless you John.
@sin_alpha3373
@sin_alpha3373 2 жыл бұрын
Bcs he uses human language
@barbe7818
@barbe7818 2 жыл бұрын
Implementing the interface is literally more relevant than extending a class limited by a single inheritance, thanks a lot for mind illumination 💡in Java ^L^
@sahilbaori9052
@sahilbaori9052 2 жыл бұрын
Wait, multi threading is covered in uni?
@richskater
@richskater 2 жыл бұрын
@@sahilbaori9052 If you go to a school that's known for it's CS program, maybe. If you're like me and went to school that's known for it's Nursing and Social Work programs, but just happens to have a CS program, then I highly doubt it. "Advanced Data Structures" was just stacks and queues, we never got into hashmaps and stuff. "Software Engineering" (a 3rd year course) was the first mention of inheritance and it was just "you could, in theory...", not a "here's how, overwrite this, something something polymorphism". By the end I hadn't learned anything that wasn't covered in my AP Java book from Highschool.
@FlexGC
@FlexGC 2 жыл бұрын
@@richskater sounds like ez degree
@keoniromano1479
@keoniromano1479 Жыл бұрын
This man can teach this stuff so much more effectively and clearly in a few seconds just to get it out of the way than any of the teachers I've had in school trying to explain in "detail" after telling you that it's "just the way it is" for like a month. Respect.
@CodingWithJohn
@CodingWithJohn Жыл бұрын
Thanks a ton!
@Kazner0h
@Kazner0h 11 ай бұрын
Bro that "It's just how things are" explanation is the WORST.
@HocineFerradj
@HocineFerradj 8 ай бұрын
He deserves it
@Ninnz_
@Ninnz_ 7 ай бұрын
I confirm
@69k_gold
@69k_gold 2 жыл бұрын
Used multithreading to create 5 Google accounts at the same time to like this video 5 times
@musicalminute1287
@musicalminute1287 2 ай бұрын
And that’s exactly what multithreading is not meant to be used
@jodathassan8894
@jodathassan8894 21 күн бұрын
Omg really?????
@pt_trainer9244
@pt_trainer9244 2 жыл бұрын
Don't know why this doesn't have more views. Very clear and straight to the point explanation. Thank you =)
@javoxirabdullayev5038
@javoxirabdullayev5038 2 жыл бұрын
It is just a beginning
@misterdneh
@misterdneh 2 жыл бұрын
Probably because people code incorrectly 😆
@jjjbrke3888
@jjjbrke3888 Жыл бұрын
I have been looking for a basic, clear, organized, and practical explanation of multithread for a long time. John not only cut down to simple words, but his short explanation also met all my expectations. Kudos, John! What a way to simply otherwise obscure concepts.
@2poreSnaxAir
@2poreSnaxAir 2 жыл бұрын
I am so glad KZfaq suggested this channel. All these videos are useful, direct to the point, and show great examples. It's difficult for me to learn the traditional way. I can't just read something and understand it. Thank you so much for what you're doing.
@arthursoave93
@arthursoave93 2 жыл бұрын
You have no idea how much you help me everyday. It's really easy to forget the basics and the fundamentals but watch your videos help me to keep on track with that. Thank you, John!
@asherkhan2656
@asherkhan2656 2 жыл бұрын
Though I am somewhat of an experienced developer, I felt I learned something new in this simple and sweet explanation of multithreading. Keep up the good work John
@AdrianTregoning
@AdrianTregoning 7 ай бұрын
I'm literally paying for a Java course and yet constantly find myself coming back to your videos John. So well explained. Perfect!
@xskrish
@xskrish 2 жыл бұрын
this was SO well explained, I was scared of Java multithreading for such a long time until I came across this video! thanks a lot!
@sianwa11
@sianwa11 9 ай бұрын
Java was my first language but I quickly dropped it because of how complex it was. I'm on a relearning journey and your videos are really helpful. Thanks!
@ilovefood43cheese
@ilovefood43cheese 2 жыл бұрын
Great tutorial! The way you explain it is such a relief. Typically, people go into so much detail and forget to first just explain how it works. I mean, details are great and all, but put the basics first. You do that and it's great, thanks!
@Mukeshotwani
@Mukeshotwani 2 жыл бұрын
Great content John.
@keoniromano1479
@keoniromano1479 Жыл бұрын
this man literally teaches me even the basic stuff that no one else ever did and I love him for it
@Tuxon24rus
@Tuxon24rus 2 жыл бұрын
Hello, John! It is so inspiring to learn Java with you! I hope you'll make a video for thread safety, it's so challenging for me to understand the usage of synchronized keyword (especially what happens behind the scenes and how does it affect the data when a synchronized method calls unsynchronized one).
@pepp0tube
@pepp0tube 2 жыл бұрын
Hi John, I agree with Tuxon24rus: a video about synchronization would be really appreciated. Thank you!!
@adityagitte
@adityagitte 2 жыл бұрын
i can't thank you enough for this video! This is the shortest and the most concise video that i have seen on multi-threading, this is like a 40 page chapter in my book. Thank you!
@cobalt79R
@cobalt79R 2 жыл бұрын
After 5 years of software engineering, I wouldn’t guess I would learn multithreading in 10 mins. Thanks for this awesome, to the point video.
@TheNickolayKanals
@TheNickolayKanals 2 жыл бұрын
U didn't learnt multithreading lol. This video didn't covered even 10% of information you need
@cobalt79R
@cobalt79R 2 жыл бұрын
@@TheNickolayKanals It covered enough to get me going and add up to it which in the end helped me land a job
@l1b3rator
@l1b3rator Жыл бұрын
@@cobalt79R There are a ton of other things, Concurrency API, synchronizing, using Monitors (Locking), using CyclicBarriers etc etc. I never worked in IT, i am just doing it for hobby, and i see that many people that worked in the industry know so few things about core Java ..... Is this the norm? can you really program in Java without knowing Java Core ?!? Multithreading is not used? or is it dealt with by frameworks ?
@chikipichi5280
@chikipichi5280 Жыл бұрын
Is multithreading not a normal thing needed in software engineering? I don't know much about the field.
@_.Prometheus._
@_.Prometheus._ Жыл бұрын
@@l1b3rator only few important stuff in java is required to create a working software. Like constructors are made by compiler so no need to impletment abstract constructors everytime. Same with destroying objects. Jvm takes careof it
@davidhakobyan7270
@davidhakobyan7270 2 жыл бұрын
You are totally the person a lot of beginners need. I have 2 years experience but anyways watch your videos and still have things to learn. Thanks a lot!
@MyzticBean
@MyzticBean 2 жыл бұрын
You are an absolute genius when it comes to explaining concepts in the simplest of terms. I really regret having found you so late in my life. Keep up the great work.. 👍
@ichigo169_g7
@ichigo169_g7 2 жыл бұрын
I was planning on looking into this tomorrow and trying to implement it into my self study project. Much appreciated!
@akaDL
@akaDL 2 жыл бұрын
For years i've never understood mulththreading. Now in 10 minutes i fully understand. You really deserve a lot more.
@kaedeumi2072
@kaedeumi2072 Жыл бұрын
A very straightforward and intuitive explanation that explains even better than my official lecture slides. Awesome!
@bsmanjunath8323
@bsmanjunath8323 2 жыл бұрын
Thanks a lot for this. A friend of mine shared this video. This helped me a lot to understand the simple concepts of threads and was able to implement the same in the project. Thanks John
@arrypandowo1546
@arrypandowo1546 Жыл бұрын
I just read a book for 3 hours and your explanation is way easier to understand to grasp the basic concept of multithreading, thank you so much, John, you are awesome
@prashantchauhan1573
@prashantchauhan1573 Ай бұрын
The best explanation on KZfaq I have come across till now ...!!!!!!!! You rock John
@johndrowned7170
@johndrowned7170 Жыл бұрын
This has been by far the most concise explanation of Multithreading I´ve ever seen.
@therealtulip
@therealtulip Жыл бұрын
What a helpful video! Short, clear, and straight to the point. Thank you!
@anpadjahil9711
@anpadjahil9711 2 жыл бұрын
Couldn't have been more simpler! Thanks a lot John!!
@gael6252
@gael6252 2 жыл бұрын
Amazing, I will start with Java next semester and I can already see several ways I could implement Threads on my oncoming assignments, keep doing this quality videos!
@pranitha1171
@pranitha1171 Жыл бұрын
Its 200% clear and your explanation is 500% understandable. I always follow you for every concept that i need. Please dont stop this channel.
@newvemo
@newvemo 3 жыл бұрын
Thanks John, you're a genius, I was waiting for this as I requested, god bless you and keep it up helping people to reach their dreams on coding, Thanks
@rxphi5382
@rxphi5382 Жыл бұрын
I love the fact that all your videos are indeed very "clear and understandable"❤
@mklcrsh
@mklcrsh 2 жыл бұрын
So clear, thank you for this video. Can’t wait to start a project with multi threading!
@PratikKumar42
@PratikKumar42 2 жыл бұрын
Please don't stop these series, it helps alot in learning.
@ravireddyism
@ravireddyism Жыл бұрын
Sambaar piyo aur sojaav
@weinsim3856
@weinsim3856 2 жыл бұрын
These videos are so good. You do such a great job explaining thins in a way that really gets to the point and that makes it really enjoyable to watch. Great job, keep up the awesome work!
@Chakrabortykuntal
@Chakrabortykuntal 2 жыл бұрын
Really great video, I have never been so clear about how multithreading works . Thanks John.
@pravalkollipara9803
@pravalkollipara9803 2 жыл бұрын
Learned this concept in class and was very confused. This video explained it so much better, thanks!
@tysontakayushi8394
@tysontakayushi8394 Жыл бұрын
Beautiful explained! I watched it some months ago and I wasn't able to understand it. I gave it some time and now everything sounds clear and simple.
@newton94
@newton94 2 жыл бұрын
Great tutorial, I am total noob in Java but everything you just said was easy to understand and fun to watch.
@ezekielthemack
@ezekielthemack 2 жыл бұрын
Thanks for your help John in explaining this rather complex (I think) subject matter. You explained it very clearly and concisely. Much appreciated.
@ShivangGulati
@ShivangGulati 7 ай бұрын
10 mins and this man saved hours of hopelessly running around on KZfaq watching confusing shit. Thankyou!
@ManojKeerthy555
@ManojKeerthy555 Жыл бұрын
Thank you so much John! I have never felt so ease in understanding a topic(which btw takes years to understand). And also you are the first youtube channel which I have subscribed within the first 3 minutes of watching the video.
@claudiograsso
@claudiograsso 2 жыл бұрын
Congrats!!! Straight to the point. No blah, blah, blah, Thanks a lot!!!
@albertotroni3852
@albertotroni3852 4 ай бұрын
My teacher showed us your video in class, but i really didn't want to listen to the lesson. But now at home i watched the entire video and i find it really clear even if English is not my primary language and my coding skills are not the best. Huge thanks from Italy!!!
@MohammadYs77
@MohammadYs77 2 жыл бұрын
very easy to understand, short, and very useful. Thank you.
@ryanhill1505
@ryanhill1505 Жыл бұрын
These videos are a delightful introduction to the language. I'm a seasoned Go developer moving into Java. I've been sad about that transition, as Go is so elegant and lightweight. Java seems big, bulky, and complicated by comparison. But John! You're quickly cheering me up. Your attitude is infectious, you naturally bring out Java's own elegant design, and you indirectly answer several other questions for each one you address head-on. For instance, in this one, I see that a Java thread is dedicated to a runnable, and that exceptions on a spawned thread - even runtime ones - do not, by default, bubble up out of that thread's context into the main one. Thank you!
@aksharjoshi3384
@aksharjoshi3384 2 жыл бұрын
I was struggling and pulling my hair over this. I love you. Now I understand why threads are important in the first place. Knowing their purpose has made it easier for me to understand them.
@danieltokai3853
@danieltokai3853 2 жыл бұрын
Great pacing, explanation, and visuals!
@monnishs9775
@monnishs9775 7 ай бұрын
Never understood this in my class but now i am very excited to use it in my programs, Thank you John.
@metall7331
@metall7331 Жыл бұрын
Beatiful explanation. I've taken college courses and read programming books but none of them explained it as eloquently as this. Thank you for making this video! 😊
@mohamad.golshani
@mohamad.golshani Жыл бұрын
Wow! John i wish you had an idea about how much your explanations seems clear and understandable to me. World class stuff!
@fullmetaltheorist
@fullmetaltheorist Күн бұрын
This is literally the best explanation on KZfaq.
@knochenmarc117
@knochenmarc117 2 жыл бұрын
I just recently stumbled across this channel and easy one of the, if not the best, coding channel. The way you explain this stuff is so nice and easy to follow. Hell I even watch it during my free time for fun. Never experienced that before with Coding Tutorials.
@SuperWaavy
@SuperWaavy 2 жыл бұрын
You explained in 10 minutes what my prof couldn't do in 4 hours. Thanks John
@Guillen8606
@Guillen8606 2 жыл бұрын
If I ever have a doubt I just come to this channel. Thanks for the great and simple explanations John
@unizfrhn2803
@unizfrhn2803 2 жыл бұрын
Holy Moly brother!!!!! Thanks so much for this tut. This taught me so many things and also in quick time than any of the freaking Professors in University. A life saver !!!! Hats off to you, sir.
@joonMayer
@joonMayer Жыл бұрын
Had to pause in the middle of the video to comment about how good this video is!!!!!!! Such great content
@jerin8121
@jerin8121 2 жыл бұрын
Thank you so much for making everything simpler.
@whitingtennis4914
@whitingtennis4914 2 жыл бұрын
Incredibly clarifying - thanks!
@andersongalvao7550
@andersongalvao7550 2 жыл бұрын
I'm going to try that out as soon as possible. I'm really pumped!
@thewildben3929
@thewildben3929 Ай бұрын
wtf was that so easy to understand, literally one of the best turorials ive ever seen
@user-zu3mu9je9c
@user-zu3mu9je9c 4 ай бұрын
So glad, I found your channel. Everything is crystal clear
@D0Samp
@D0Samp 2 жыл бұрын
One more advantage of the Runnable interface besides extensibility is that you can reuse objects in new threads where it's useful, especially if they contain a significant amount of data. Thread objects are used up after they are done executing. Alternatively, Runnables also can be handed to an Executor to decouple them further from the thread that actually executes them.
@misterdneh
@misterdneh 2 жыл бұрын
This explains a lot more now, definitely helped ease my brain on the level of Threading
@meduriravindra4238
@meduriravindra4238 2 жыл бұрын
Please explain more concepts that really help in real time. It’s really great learning from an experienced guy like you. Thanks a lot.
@fardinshah7357
@fardinshah7357 2 жыл бұрын
Thank you man!! Thank you !!!!! Thank you !!!!! Thank you !!!!! Thank you !!!!! You just literally explained what my teacher tried to explained in 1 month. Please continue this series. There are not many good lecture .
@subhampaul8351
@subhampaul8351 2 жыл бұрын
Explained so easily. I just want to say thank you for all your videos.
@abdulazeez180
@abdulazeez180 2 жыл бұрын
You have no idea how much you have helped me ! Thank you , keep up the great work !
@miishaaq1088
@miishaaq1088 2 жыл бұрын
Thank you so much John for such marvellous explanation clearing all doubts within no time
@abhimanuwalia5755
@abhimanuwalia5755 Жыл бұрын
i could not imagine anyone could explain it better, Thank you
@davisoares26
@davisoares26 2 жыл бұрын
Man, what an explanation! I was going crazy with this multithreads in java... Thank you very much!!
@noah.2628
@noah.2628 2 жыл бұрын
Very useful indeed. I am making a chatapp in Java and I really needed this. Thanks!
@david3979
@david3979 2 жыл бұрын
This is such a great video! I wish I could see how to print those numbers once with 4 threads running them asynchronously (including sleeps). Thank you for the time and effort!!
@nivethak7326
@nivethak7326 2 жыл бұрын
In 10 mins if you want to learn any concept clearly ,then this channel is the best..❤️❤️
@ighsight
@ighsight 2 жыл бұрын
Excellent. I was really expecting this to be kind of difficult to do.
@vibhashreehippargi8233
@vibhashreehippargi8233 Жыл бұрын
Never understood it until i watched this tutorial. Just amazing! :)
@Play_Streams
@Play_Streams 2 жыл бұрын
Simple & concise. Thanks John!
@williamlewington3223
@williamlewington3223 2 жыл бұрын
Concise, clear and simple explanations. Keep up the good work.
@swapnalipatil5019
@swapnalipatil5019 Жыл бұрын
Best Java related videos I have ever come across.
@karthiks1765
@karthiks1765 Жыл бұрын
This man has rekindled my long dead love for Java. What a teacher. Respect. ✊
@vishwaratna
@vishwaratna 2 жыл бұрын
Being a java developer myself I can vouch for John, a very clear explanation.
@RyanDeckard
@RyanDeckard Жыл бұрын
What an outstanding job of explaining concepts in Java. Brilliant and appreciate your videos.
@sp3ctrums264
@sp3ctrums264 2 жыл бұрын
Clear and straight forward explanation. Very helpful
@afaftaha1020
@afaftaha1020 2 жыл бұрын
That reeaally really was awesome and so simple that I'm asking my self why didn't I understand this from other people! Thank you so muuuch
@iancesarvidinharego9601
@iancesarvidinharego9601 9 ай бұрын
Your way to learn is FANTASTIC!
@rayanechaoub3721
@rayanechaoub3721 2 жыл бұрын
Incredible explanation, thank you!
@chipotle555
@chipotle555 Жыл бұрын
Best video! So simple and precise, best video on multithreading found so far!
@shashe42
@shashe42 6 ай бұрын
I'm interacting just to feed the algo but I learned something in at least one other video of yours as well, so I subscribed as well. I feel like I'm going to binge a lot of your videos over the coming months. Your video editing and script planning is on a similar level to your Java knowledge. which is high praise for all of the above..
@kharcasse5303
@kharcasse5303 2 жыл бұрын
This is such a great video. You made this so easy to understand.
@naveenkumars8570
@naveenkumars8570 Жыл бұрын
4 hours i took to learn Multithreading and you just did in 10 minutes, Thank You.
@siniravindran6956
@siniravindran6956 Жыл бұрын
Thank you so much. This entire day I was trying to find some issue with the code that I have written on multiple threading. Just before bed saw this video and I am not sure if the issue would b solved but I think I got it. You explained this in a simple way . Literally as the title says in 10 minutes. Thanks again
@frenktalks4502
@frenktalks4502 Жыл бұрын
Thanks John, simple and easy understandable. and... really "hands-on" explanation - great job! 👍
@rafaelwu
@rafaelwu 2 жыл бұрын
I'm so glad that I found your videos
@tichaonamiti4616
@tichaonamiti4616 Жыл бұрын
Simple and straight to the point..... you are the best
@bengi8406
@bengi8406 2 жыл бұрын
Respect + Man, wish my teacher was this good at explaining stuff...
@urnotSylvia
@urnotSylvia Жыл бұрын
Thank you John! Clearly explained!
@sitanshukirtivardhan5877
@sitanshukirtivardhan5877 Жыл бұрын
Amazing video.. solved my doubts in minutes.. love from India !!
@awalehhoussein3099
@awalehhoussein3099 2 жыл бұрын
I was confused until now. Thanks a lot.
@mahmoudbaddary7596
@mahmoudbaddary7596 7 ай бұрын
You are the best one I've seen explains java, really thank you
@pridurok4228
@pridurok4228 2 жыл бұрын
Very informative and comparably short video, Thank you very much.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Java multithreading 🧶
15:18
Bro Code
Рет қаралды 121 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 14 МЛН
The joker's house has been invaded by a pseudo-human#joker #shorts
00:39
Untitled Joker
Рет қаралды 7 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 106 МЛН
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 84 МЛН
Array vs. ArrayList in Java Tutorial - What's The Difference?
17:36
Coding with John
Рет қаралды 497 М.
Multithreading Code - Computerphile
15:54
Computerphile
Рет қаралды 379 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 629 М.
Thread Pools in Java
18:04
Jakob Jenkov
Рет қаралды 63 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,1 МЛН
13.7 Multithreading Synchronized Keyword
10:17
Telusko
Рет қаралды 431 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 14 МЛН