Java Multithreading Interview Questions and Answers || Daemon Thread in java || Part 2 (Live Demo)

preview_player
Показать описание
In this video of code decode, you will learn Multithreading Interview Questions and Answers in Java which is important in Java Interview Questions and Answers

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

Multi threading Interview questions part 1

Q) How to make a user thread to a Daemon thread

make a user thread to Daemon by using setDaemon() method of thread class.
public boolean isDaemon(): This method is used for checking the status of a thread. It returns true if the thread is Daemon else it returns false.
The main difference between Daemon thread and user threads is that the JVM does not wait for Daemon thread before exiting while it waits for user threads, it does not exit until unless all the user threads finish their execution.

Q) What are the tasks of start method

Register the Thread with thread scheduler. So you just tell what a child thread should do, when and how it will be scheduled will be handled by scheduler.

Call run method.

Q) What if we don’t override Run method?
Thread class Run method will be called and we won’t get any output.

It’s basically useless as you are saying, please create a thread for me and that thread will do nothing for us. So why did u create it ?

Q) Can we overload run method during multi threading?
How do we overload?
May be by passing parameters?
Yes you can but start () will call no arg run () only.

Q) Can we override start method of thread in multi threaded environment?
If you override start () in your custom class then no initializations will be done by thread class for you.

Q) What is Multi threading & how is it diff from multi tasking asked In java interview question and Answers

Multithreading is a specialized form of multitasking.

Process-based multitasking is executing several tasks simultaneously where each task is a separate independent process is Process-based multitasking .
For example, process based multitasking enables you to run the Java IDE at the same time that you are using a text editor or visiting a web site using chrome.

Thread-based multitasking is executing several tasks simultaneously where each task is a separate independent part of the same program (called Thread).
For instance,JUnit uses threads to run test cases in parallel. As an application, you can have computer games. You see objects in games like cars, motor bikes etc. They are just threads that run in the game application.

Thus, process-based multitasking deals with the “big picture,” and thread-based multitasking handles the details

----------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------
Subscriber and Follow Code Decode

#javainterviewquestions #multithreadinginterviewquestions #codedecode
Рекомендации по теме
Комментарии
Автор

Hey guys, as per the request we have tried to reduce the pace. if it's fine just let us know else from next video shall we continue with the existing (a bit faster) pace ?

CodeDecode
Автор

I really like it how you give the transcript as description. It saves a lot of time and helps in quick glance . I sincerely appreciate all the efforts and keep up the good job

nandakumarb
Автор

Waiting for part 3! Please upload if possible! Thanks for your contribution.

ronitsahu
Автор

Great explanations most of the questions that you have covered are repeated in majority of the interviews.

One question i came across.
Find if a number is odd or even or prime using three threads, and the result should maintain the natural order

avinashxvr
Автор

Please continue with part 3 as well. Your videos are really helpful in understanding these concepts. I've #subscribed the channel and eagerly waiting for upcoming part.☺️

secretsociety
Автор

Please continue with the video of remaining topics. Content is very help full.

madhanmmm
Автор

I'm really impressed your explanation please make more videos to continue this multithreding concepts, I'm watching all the other videos as well because good explanation

TheAnaveni
Автор

Thanks madam.. I understood about threads now.. please continue it

iask
Автор

This channel deserve more subscribers . Great content and explanation
Thank you ma'am

techiebrat
Автор

hi Ur videos are excellent .we can crack most of the interviews be referring all Ur playlist . plz cover executers in multithreading also .

lathasree
Автор

Thanks for these kind of content.. they are really helpful.. i really appreciate your hardwork...

TheEntium
Автор

Ma'am kindly continue the third part as well as add Exector, fork join as well

saumilwaghela
Автор

need next part as well...pls do make video on other methods as well Madam... Thanks in advance

coolniki
Автор

Nice Videos till now watched all videos of Interview Questions playlist, please collect the more interview questions for java, spring and keep post regularly. we want interview questions😋. subscribed waiting for the videos.

chilukabharath
Автор

@codedecode thank you so much ma'am for such great efforts and creating such useful videos and making learning java concepts easy.


Could you please make next videos on multithreading? In many interviews I was asked about thread life cycle, thread pool, thread executor framework. Thank you in advance.

Shubhada-wj
Автор

Thank You for awesome explanation....Please upload next video....

crazeeealgorithms
Автор

Great content!! Please have more videos on threads, life cycle, join, thread executor, future, etc

lodhaaashish
Автор

Please add 3rd Part of this video. Much needed

manishkartik
Автор

Next video please for multithreading. It's very good set of questions. Please include interview questions for executor framework as well.

athithirajeshu
Автор

Wonderful, very good explanation. Please try to group all of them by providing links to the previous videos. This will help users to connect previous sessions....

jayakrishnathammana