
Java Interview Guide : 200+ Interview Questions and Answers - Thread states, priority, ExecutorService and Callable
Interactive Video
•
Information Technology (IT), Architecture
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Read more
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which state is a thread in when it is created but not yet started?
Blocked
Runnable
Running
New
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when two threads have the same priority?
Both threads run simultaneously
One thread is ignored
The CPU allocates time equally between them
The thread with the lower ID runs first
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default priority assigned to a Java thread?
5
1
10
0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of an Executor Service?
To increase thread priority
To manage and execute tasks in the background
To terminate threads
To create new threads
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to check if a task executed by an Executor Service is complete?
checkStatus()
isComplete()
get()
isDone()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a key advantage of using Callable over Runnable?
Callable can return a result
Callable is faster
Callable uses less memory
Callable is easier to implement
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method in the Callable interface is used to return a result?
run()
execute()
call()
start()
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?