Easy Tutorial
For Competitive Exams

Java Programming Threads

1597.Two threads cannot simultaneously enter into the methods of the same object if the methods are
static
synchronized
private
package
1598.While using threads which of the following is incorrect?
You invoke the Run method
You implement Runnable interface
You extend from Thread class
You call the start method
1599.What is the name of the method used to schedule a thread for execution?
init()
start()
run()
resume()
1600.What is the default priority of a thread in Java?
10
5
3
1
1601.A thread becomes not runnable when
its sleep method is invoked
the program terminates
a network connection is established
an event occurs
1602.What is the default priority of a newly created thread?
MIN_PRIORITY
NORM_PRIORITY
MAX_PRIORITY
None of these
What will be the result of invoking the wait() method on an object without ensuring that the current thread holds the lock of the object?
while the current thread does not hold the lock of the object
1604.Which one of the following is a static member of Thread ?
currentThread()
join()
getName()
interrupt()
1605.Select the valid thread state transition?
ready to running
ready to waiting
waiting to running
running to ready
1606.What is dead thread in java ?
A thread that is waiting for I/O operation
A thread completed its run method
A thread is in sleep
None of these
1607.Which of these class is used to make a thread?
String
System
Thread
Runnable
Explanation:
Thread class is used to make threads in java, Thread encapsulates a thread of execution.
To create a new thread the program will either extend Thread or implement the Runnable interface.
1608.Which of these interface is implemented by Thread class?
Runnable
Connections
Set
MapConnections
1609.Which of these method of Thread class is used to find out the priority given to a thread?
get()
ThreadPriority()
getPriority()
getThreadPriority()
1610.Which of these method of Thread class is used to Suspend a thread for a period of time?
sleep()
terminate()
suspend()
stop()
1611.Which function of pre defined class Thread is used to check weather current thread being checked is still running?
isAlive()
Join()
isRunning()
Alive()
Explanation:

Explanation:isAlive() function is defined in class Thread, it is used for implementing multithreading and to check whether the thread called
upon is still running or not.
1612.What is multithreaded programming?
Which of these are types of multitasking?
It’s a process in which two different processes run simultaneously.
It’s a process in which two or more parts of same process run simultaneously.
Its a process in which many different process are able to access same information.
Process based
Explanation:
d. Its a process in which a single process can access information from many sources.
multithreaded programming a process in which two or more parts of same process run simultaneously.
1613.Which of these packages contain all the Java’s built in exceptions?
Thread based
Process and Thread based
None of the mentioned
javio
Explanation:
There are two types of multitasking: Process based multitasking and Thread based multitasking.
1614.Thread priority in Java is?
java.util
java.lang
java.net
Integer
Which of these statements is incorrect?
Solution:
Java assigns to each thread a priority that determines hoe that thread should be treated with respect to others.
Thread priority are integers that specify relative priority of one thread to another.
Share with Friends