Multithreading Interview Questions
Multithreading Interview Questions
Interview Questions
WWW.JAVA2BLOG.COM
Que: What is Multithreading?
Multithreading is a process of executing
multiple threads simultaneously.
www.java2blog.com
Que: What are advantages of
thread over the process?
Thread is a separate path of execution.
www.java2blog.com
Que: How we create a thread in
Java?
In Java we can create a thread using two ways:
www.java2blog.com
Que2: Differences between sleep()
and wait() ?
www.java2blog.com
Que: what you understand about
Thread Priority?
We can assign priority to threads so that the
highest priority thread will execute first then low
priority thread will get executed but it mostly
depends on thread scheduling algorithms. we can
assign priority to threads from 1 to 10. 1 is a low
priority, and 10 is a high priority.
www.java2blog.com
Que: Difference between the User
thread and Daemon thread?
If we create threads in Java, these threads are
called User threads. Daemon threads are low
priority threads that are used to provide
services to user thread. Daemon threads run
into the background.
www.java2blog.com
Que: How can we pause the
execution of the thread
for a particular time?
We can call sleep() to pause execution of the
thread for a specific time. When we call sleep
method for a thread it will switch to the waiting
state for a specific time and after time interval
expires thread moves to runnable state.
www.java2blog.com
Que: what is synchronization?
www.java2blog.com
thank you
WWW.JAVA2BLOG.COM