Top 100+ Advanced Multithreading Interview Questions 2019-2020 - 2
Question: 6
What are the uses of synchronized keyword?
The keyword synchronized is used to acquire a exclusive monitor lock on an object. It can be used to mark either a method or a block of code.
In both cases, it means to acquire a lock for the duration of the method, or block and to release the lock at the end.
It also takes a parameter, which names the object, whose lock will be acquired.
Question: 7
How does serialization work?
It’s like FIFO method (first in first out).
Question: 8
How can one thread wait for another thread to die before it continues execution?
The thread’s join() method allows you to wait for another thread to finish execution.
Question: 9
What are the different ways of creating thread?
Implementing Runnable: The Runnable interface defines a single method, run, meant to contain the code executed in the thread.
Subclass Thread: The Thread class itself implements Runnable interface, though it runs method does nothing.
Question: 10
What is Executors class?
Executors class provide utility methods for Executor, ExecutorService, ScheduleExecutorService, ThreadFactory and Collable classes.
Executors class can be used to easily create ThreadPool in java, also this is the only class supporting execution of callable implementations.
- Java Multithreading Interview Questions and Answers for Freshers
- Top 100+ Java Multithreading Interview Questions and Answers
- Top 100+ Advanced Multithreading Interview Questions 2019-2020
- Java Interview Questions and Answers for Experienced Professionals
- Java 9 Interview Questions for 1,2,3,4,5,6,7,8,9,10 Years Experience
Analog Electronics Questions Pdf Download with Answers More
Engineering Materials Science MCQ Questions & Answers More
Material Science MCQ Questions Pdf Download More
Dairy Technology MCQ Questions and Answers More
Agricultural Engineering MCQ Questions & Answers Pdf More
100+ Line Charts Data Interpretation Questions and Answers More
100+ Tally Practical Questions & Answers Pdf Free Download More
Top 1000+ Synonyms and Antonyms Questions for Bank Exams More
Animation Interview Questions and Answers Pdf More
Cells and Batteries MCQ Objective Quiz Questions & Answers More