Multithreading is a type of multitasking based upon threads i.e. context switching is done in-between threads.
A thread is a lightweight process. Thread uses process’s execution environment i.e. memory area. Context switch time is less in case of processes because switch is done within the same process’s memory area.
Java interview questions on multithreading
- What is multithreading?
- Difference between process and thread in java?
- What is thread in java?
- What is the difference between preemptive scheduling and time slicing?
- What is join method in java?
- What is the difference between sleep and yield method?
- Is it possible to start a thread twice in java?
- Can we call run method directly in java?
- What is daemon threads in java?
- Can we make the user thread as daemon thread if thread is started?
- Difference between thread start and run method.
- Why we call start method in thread?
- Which is a better way to create a thread in java?
- Can we override start method?
- Can we override run method?
- How to get current thread in java?
- What is synchronization?
- What is synchronized block in java?
- What is synchronized method in java?
- What is static synchronization in java?
- What is deadlock in java?
- What is starvation in java?