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 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.
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.
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!
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!!!
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.
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
I have been struggling with java in my late 30s (I am stubborn - I will make it all by myself) with help of online tutorials and mostly books. But each time i start a new complicated (or rather complex) topic - i watch John's video on youtube, get the idea, and then proceed with 5-6 hours tutorial on the same topic. Otherwise, sometimes it is really difficult to understand what is going on. Thanks Johnny for such great videos. Kudos from Azerbaijan!
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
UA-cam is something which I learnt more than any college I prepared gate did well from UA-cam Even apti for campuss interview My frnd got 8000 rank in JEE mains from UA-cam it's blessing for this era Thanks prof jhon
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!
@@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 ?
@@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
I saw a 20 minutes video of a guy doing a Thread. This guy used run. He used fkn run, and there I was, wondering what's the purpose of threads if my program had to stop execution after running the Thread. You are an amazing teacher.
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.
When I started Java a few years ago it was truly hard, much harder than C was for me at that moment. After taking OOP with a crazy as hell college prof, Java truly grew on me, I learnt a lot, and from you I'm also learning much more
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).
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!
Nice overview of the principals however, there are many aspects that demand one or more follow-up videos on this topic: - How to work with threads that use an infinite loop (interrupt mechanic...) - How to write thread-safe code (synchronize mechanic...) - Wait and notify inside of synchronize-blocks - How to transport an exception that occurs on a thread to the main thread (is there actually a build-in mechanic?) - Future objects - Multi-Threading in Swing (Event dispatch thread and how not to use it ... SwingWorker) - Parallel Streams (findAny vs. findFirst) One point that could have been demonstrated in a better way in this video: You could have created an array (or list) of threads and call the join method in a separate loop after all threads have been started, followed by some code that is run after all threads have finished. That way you could have shown a use case where you separate a complex computation in multiple threads and collect the results after all of them have finished.
This is why threading is such a hard concept to tech concisely. It’s literally a topic that people have based their careers on because there are so many little details to understand.
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.
I am so glad UA-cam 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.
In case anyone watching this doesn't like creating a separate class for multithreading, another option (available in java 8 or higher) is to use a lambda expression, since Runnable is an interface with a single abstract method, if you use a lambda expression the compiler will create the class for you, the syntax is () -> System.out.println("Lambda") passed as an argument for example, it can also be used with interfaces that have a method with different parameters, where you put them between the parenthesis, and you can even return a value
This is the BEST explanation I have seen! Thank You!! There is one caveat and that is this is the high level view. The low level view is that, depending on the platform, it may not be happening at the exact same time.
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.. 👍
Would love to hear you explain things in more details, such as how the internals work for Threads, Heap memory, Stack memory, use of the Volatile keyword, avoiding race conditions on shared resources when working in a multithreaded program : )
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!
Hi Jhon, you talk fast, but i can tell that i've reported all the code in the video, and it works perfectly, especially when i introduce start command, sometimes i have in the same run session different thread order execution....thant you so much Jhon.
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.
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
When you told about runnable interface I paused the video and was thinking that then why it is different from Thread class and when I continued I got my answer. Only a real teacher can do this thing
John, I have been following your Java course videos for quite a while now. They are good and helpfull. I have a request/suggestion for you, have you ever thought of making videos on the interview questions(say 100 questions on core Java, 100 on advanced Java, something like that may be more or less ). If at all, if you want look into preparing these videos take the points below into consideration please. 1) These videos are for the people who know Java already and they watching to fine tune themselves to understand the interviewer expectations and crack the interview. 2) Saying only once no repetitions in the video at any cost. To the point, precise, concise. If the viewers want to watch again they go back and replay always. Repetition will be pretty boring for the people who watch with full attention and concentration,. 3) Slow and average speed of the flow of the video, is what I would suggest. Of course viewer can change but by default if you can make it of that way it would be good. Thanks.
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 .
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..
It is a very example, I don't know nothing about Multithreading and now I feel more comfortable with this topic. Thank you John. One additional comment is, can you explain in a real programming scenario what can be the porpuse of Multithreading ?
Thx u for multithreading teach. Before a few hours, I didn't understand that but now I watching this video, I totally understand that. this is slayyyyy!!
The Good: You were clear on a technical topic. The Bad: You ran through it rather quickly. I'm having trouble using the second method you described. Could you make another threading video that focuses on implementing the runnable interface and that shows how someone can run multiple threads that are not the same thread? Does input/output work in multiple threads?
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
You have a gift for teaching that few people have this is a great video its concise, effective, covers the the basics in an easy to digest manner. thanks for the video it really helped.
Used multithreading to create 5 Google accounts at the same time to like this video 5 times
And that’s exactly what multithreading is not meant to be used
Omg really?????
LOL! running 5 Google account in your machine at a time can be called multi tasking or somehow multithreading... Not creating 5 Google account!
What a joke he crack🥳
Literally explains more than my Professor does in 6 hours, God bless you John.
Bcs he uses human language
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^
Wait, multi threading is covered in uni?
@@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.
@@richskater sounds like ez degree
10 mins and this man saved hours of hopelessly running around on UA-cam watching confusing shit. Thankyou!
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.
Thanks a ton!
Bro that "It's just how things are" explanation is the WORST.
He deserves it
I confirm
Don't know why this doesn't have more views. Very clear and straight to the point explanation. Thank you =)
It is just a beginning
Probably because people code incorrectly 😆
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!
Please don't stop these series, it helps alot in learning.
Sambaar piyo aur sojaav
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!!!
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.
You have to keep looking than. Because he is missing like 99% of the information related tu multithreading.
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
I have been struggling with java in my late 30s (I am stubborn - I will make it all by myself) with help of online tutorials and mostly books. But each time i start a new complicated (or rather complex) topic - i watch John's video on youtube, get the idea, and then proceed with 5-6 hours tutorial on the same topic. Otherwise, sometimes it is really difficult to understand what is going on. Thanks Johnny for such great videos. Kudos from Azerbaijan!
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
I'm literally paying for a Java course and yet constantly find myself coming back to your videos John. So well explained. Perfect!
UA-cam is something which I learnt more than any college
I prepared gate did well from UA-cam
Even apti for campuss interview
My frnd got 8000 rank in JEE mains from UA-cam it's blessing for this era
Thanks prof jhon
best cs teacher ever i love john
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!
this man literally teaches me even the basic stuff that no one else ever did and I love him for it
Being a java developer myself I can vouch for John, a very clear explanation.
wtf was that so easy to understand, literally one of the best turorials ive ever seen
wow... In just 10 min I learned what I had put off for years because I thought its too complicated and its for seniors. BIG SHOUTOUT to this guy!
This has been by far the most concise explanation of Multithreading I´ve ever seen.
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.
U didn't learnt multithreading lol. This video didn't covered even 10% of information you need
@@TheNickolayKanals It covered enough to get me going and add up to it which in the end helped me land a job
@@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 ?
Is multithreading not a normal thing needed in software engineering? I don't know much about the field.
@@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
For years i've never understood mulththreading. Now in 10 minutes i fully understand. You really deserve a lot more.
You made me understand in 10 minutes what my teacher didn't do in two hours. And I don't even speak English. So, thank you for that.
4 hours i took to learn Multithreading and you just did in 10 minutes, Thank You.
I saw a 20 minutes video of a guy doing a Thread. This guy used run. He used fkn run, and there I was, wondering what's the purpose of threads if my program had to stop execution after running the Thread. You are an amazing teacher.
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!
The best explanation on UA-cam I have come across till now ...!!!!!!!! You rock John
The intro goes like "And i love sharing what i've learnt in a clear understandable way" - Every word of this is true 👌
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.
Its always delightful to see an instructor who enjoys teaching the topic so much
Great content John.
i'm trying to understand this concept for past three day and tried so many turtorials but you explained in just 10 minutes thanks a lot
When I started Java a few years ago it was truly hard, much harder than C was for me at that moment. After taking OOP with a crazy as hell college prof, Java truly grew on me, I learnt a lot, and from you I'm also learning much more
Had to pause in the middle of the video to comment about how good this video is!!!!!!! Such great content
When a person speaks fast, my attention is totally absorbed. Excellent explanation with fluency, articulation, and eloquence!!!
I am not a native English speaker and I could understand you very well. This is an excellent video, It's very clear and understandable. Thanks a lot.
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).
Hi John, I agree with Tuxon24rus: a video about synchronization would be really appreciated. Thank you!!
This is literally the best explanation on UA-cam.
3 hours lecture and i didn't understand anything , john in 10 minutes i understood everything , you da best
Great content. Make some videos on SOLID principles and Design Patterns.
You made me understand in 10 mins what my professor couldn’t in a 2 hr lecture
saved my ass at university today. explains better than my professor! Thank you so much for this video!
You explained in 10 minutes what my prof couldn't do in 4 hours. Thanks John
great video, I just came from Udemy and this 10-minute vid blew that whole course outta the water. Props...
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!
Nice overview of the principals however, there are many aspects that demand one or more follow-up videos on this topic:
- How to work with threads that use an infinite loop (interrupt mechanic...)
- How to write thread-safe code (synchronize mechanic...)
- Wait and notify inside of synchronize-blocks
- How to transport an exception that occurs on a thread to the main thread (is there actually a build-in mechanic?)
- Future objects
- Multi-Threading in Swing (Event dispatch thread and how not to use it ... SwingWorker)
- Parallel Streams (findAny vs. findFirst)
One point that could have been demonstrated in a better way in this video:
You could have created an array (or list) of threads and call the join method in a separate loop after all threads have been started, followed by some code that is run after all threads have finished. That way you could have shown a use case where you separate a complex computation in multiple threads and collect the results after all of them have finished.
Dont forget thread pools
This is why threading is such a hard concept to tech concisely. It’s literally a topic that people have based their careers on because there are so many little details to understand.
Short, clear and precise. That's how teaching should be.
This man has rekindled my long dead love for Java. What a teacher. Respect. ✊
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.
Congrats!!! Straight to the point. No blah, blah, blah, Thanks a lot!!!
I am so glad UA-cam 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.
In case anyone watching this doesn't like creating a separate class for multithreading, another option (available in java 8 or higher) is to use a lambda expression, since Runnable is an interface with a single abstract method, if you use a lambda expression the compiler will create the class for you, the syntax is () -> System.out.println("Lambda") passed as an argument for example, it can also be used with interfaces that have a method with different parameters, where you put them between the parenthesis, and you can even return a value
Turned 4 hours of trying to study my lecture notes into doing my project in 30 min, thank you John!
well.. even my english isnt the best.
You explained better then my teacher in 90mins.
Thanks alot!
This is the BEST explanation I have seen! Thank You!! There is one caveat and that is this is the high level view. The low level view is that, depending on the platform, it may not be happening at the exact same time.
Its 200% clear and your explanation is 500% understandable. I always follow you for every concept that i need. Please dont stop this channel.
Never understood this in my class but now i am very excited to use it in my programs, Thank you John.
fantastic, that 10 minutes is more valuable than my 3 hour lecture.
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.. 👍
In 10 mins if you want to learn any concept clearly ,then this channel is the best..❤️❤️
i could not imagine anyone could explain it better, Thank you
Best Java related videos I have ever come across.
Would love to hear you explain things in more details, such as how the internals work for Threads, Heap memory, Stack memory, use of the Volatile keyword, avoiding race conditions on shared resources when working in a multithreaded program : )
Thanks so much! That's some advanced stuff, but I'm hoping to get to all of it!
this dude's explanation is on a whole other level
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!
I was confused until now. Thanks a lot.
Hi Jhon, you talk fast, but i can tell that i've reported all the code in the video, and it works perfectly, especially when i introduce start command, sometimes i have in the same run session different thread order execution....thant you so much Jhon.
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.
Never understood it until i watched this tutorial. Just amazing! :)
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
amazing! 10 mins with John > 4 hours at Uni
thank you!!
Great tutorial, I am total noob in Java but everything you just said was easy to understand and fun to watch.
This explains a lot more now, definitely helped ease my brain on the level of Threading
When you told about runnable interface I paused the video and was thinking that then why it is different from Thread class and when I continued I got my answer. Only a real teacher can do this thing
Dear Master I'll be here for 3years ,thank you so far 👏👏 you nail everything so far,and your goal we are here so it is reached already 👑
John, I have been following your Java course videos for quite a while now. They are good and helpfull.
I have a request/suggestion for you, have you ever thought of making videos on the interview questions(say 100 questions on core Java, 100 on advanced Java, something like that may be more or less ). If at all, if you want look into preparing these videos take the points below into consideration please.
1) These videos are for the people who know Java already and they watching to fine tune themselves to understand the interviewer expectations and crack the interview.
2) Saying only once no repetitions in the video at any cost. To the point, precise, concise. If the viewers want to watch again they go back and replay always. Repetition will be pretty boring for the people who watch with full attention and concentration,.
3) Slow and average speed of the flow of the video, is what I would suggest. Of course viewer can change but by default if you can make it of that way it would be good.
Thanks.
Such a helpful video for a Java novice like me, I'm so glad I stumbled upon it while eating dinner. 😄
Why are you so good at explaining these things?
If I ever have a doubt I just come to this channel. Thanks for the great and simple explanations John
Your way to learn is FANTASTIC!
This is the first time i was learning multithreading and damn he made it so easyyyy.
Severely underrated channel. You deserve more subs!!
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 .
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..
It is a very example, I don't know nothing about Multithreading and now I feel more comfortable with this topic. Thank you John. One additional comment is, can you explain in a real programming scenario what can be the porpuse of Multithreading ?
This is GOLD. GOLD I tell you. I will destroy my university course.
Some people say that Java is outdated, but I still use it. It's a beautiful language, I think.
So glad, I found your channel. Everything is crystal clear
Videos like this get me through grad school. Thanks, John!
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.
I love the fact that all your videos are indeed very "clear and understandable"❤
Learned this concept in class and was very confused. This video explained it so much better, thanks!
Thx u for multithreading teach. Before a few hours, I didn't understand that
but now I watching this video, I totally understand that. this is slayyyyy!!
The Good: You were clear on a technical topic. The Bad: You ran through it rather quickly. I'm having trouble using the second method you described. Could you make another threading video that focuses on implementing the runnable interface and that shows how someone can run multiple threads that are not the same thread? Does input/output work in multiple threads?
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
Simple and straight to the point..... you are the best
You have a gift for teaching that few people have this is a great video its concise, effective, covers the the basics in an easy to digest manner. thanks for the video it really helped.
Wow!!!! Just wow!!! Amazed by the way he teaches, so quick, efficient and effective.
Clear and straight forward explanation. Very helpful