
Online Quiz on Unit-2
Authored by Rahul Badgujar
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the correct life cycle of a thread in Java?
New → Running → Blocked → Dead
New → Ready → Running → Blocked → Dead
New → Ready → Running → Waiting → Dead
New → Running → Waiting → Blocked → Dead
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following methods is used to create a thread in Java?
Thread()
run()
start()
execute()
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which method is used to pause the execution of the current thread for a specified amount of time in Java?
wait()
sleep()
join()
yield()
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will happen if the thread is in the 'blocked' state in Java?
It is currently executing.
It is waiting to acquire a lock or resource.
It is paused temporarily.
It has been terminated.
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which interface must be implemented to create a thread in Java using the 'Runnable' approach?
Thread
Runnable
Process
Callable
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the default priority of a thread in Java?
1
5
10
100
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following methods is used to set the priority of a thread in Java?
setPriority()
setThreadPriority()
setPriorityLevel()
priority()
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?