Java8 | Multithreading | 🔥 Asked in Oracle | Print Even & Odd Numbers Using 2 Thread | JavaTechie

preview_player
Показать описание
🇮🇳🇮🇳 Happy Independence Day 🇮🇳🇮🇳

#JavaTechie #Java8 #Multithreading #InterviewQ&A

In this tutorial, you will learn how to print even and odd numbers in synchronize order using the two threads in java . We will discuss below 3 approach to solve this question

👉 Solution using Java 7
👉 Solution using Executor Service & ComplatableFuture
👉 Solution using ComplatableFuture & Java 8 stream

Spring boot microservice Premium course lunched with 70% off 🚀 🚀

Hurry-up & Register today itself!

PROMO CODE : JAVATECHIE50

OR use Javatechie APP

Download the JavaTechie app on your iOS or Android device from the App Store or Google Play Store.

Find the links below :

GitHub:

Blogs:

Facebook:

Join this channel to get access to perks:

guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie

Disclaimer/Policy:
--------------------------------
Note : All uploaded content in this channel is mine and its not copied from any community ,
you are free to use source code from above mentioned GitHub account
Рекомендации по теме
Комментарии
Автор

I also had faced this question around two years back in one of my interviews. Thanks for covering this

sayanbiswas
Автор

Basant, awesome explanation, appreciate your efforts...God Bless you.

gopisambasivarao
Автор

Sir, can you please create a full detailed video on 2-way email communication in microservices using rest apis and POP3 configurations

mrmohit
Автор

I also faced this question recently thanks bro

itsmeibrahimm
Автор

Hi Javateachie,
I have been following your videos from long it helped me alot in my professional journey. Thanks a lot 🙌🏻

One request from my side, can you please created few videos on EJB and how to implement on higher level ?

kumarmahendra
Автор

Here we are checking the thread name in if condition, which violates the multithreading concept. If the odd thread is also trying to access the object still it will be thrown out because of failing the if condition. Also if we are using this condition then the code will work without synchronized block and lock.wait() and notify(). But if we remove the thread name check in the if condition, it will not work in the desired way which means odd thread is able to access the even condition also. Please suggest further

satyabratasahoo
Автор

Very nice explanation, can you please make a video to print number 1, 2, 3 from thread 1, thread 2 and thread 3 then number 4, 5, 6 from thread 1, t2, t3 and so on

singhkk
Автор

@JavaTechie thanks for knowledge sharing. If possible can you make one video on below or share me if you have any reference links
1)How can we estimate min and max number of threads to create.
2)on which parameters number of threads creation depends
3)Threads vs Core CPU

ravi.m
Автор

could you please do one video where all the multithread program questions are there, in addition to that in the interview some people asked about lots of files and how you read and process( make some change) and write in document as a output using multiple threads/Executor framework

amanabhishek
Автор

Very complex solutions, it can be done very easily without code duplication

GuruNanakTV
Автор

HI, could you make video on spring boot jwt with redies database .

Manoj-zxye
Автор

Eagerly waiting for your next microservices design pattern....😊😊😊😊

vidhanchandra
Автор

Hi basant, can you please make videos of multi threading like thread life cycle, volatile keyword, wait and sleep, synchronisation

revanthchinnu
Автор

Could u please explain what's the importance of Thread.sleep call in Main method.

kiranvish
Автор

@java techie Hi bro your last methods is incorrect...
Rerun it few times and worker-2 will get executed first..as operation is async..

MYSTERIOMAXXX
Автор

Hi sir can u create seperate series on multithreading playlist for java

reenarodrigues
Автор

In the last approach, how is the excecution sequence of odd followed by even is guranteed ?

sameergurumukhi
Автор

EvenAndOddPrinterBy2Threads is printing till 11 for 10count or 101 for 100count in my system.

dipujames
Автор

Hi can you make tutorial about JCR (Java content repository), it is hard to find tutorial online about that topic.

nilnpsn
Автор

Hi can u make tutorial on websocket implementation on spring boot microservice aritecture on api gateway example usi

sagararora
welcome to shbcf.ru