Beruflich Dokumente
Kultur Dokumente
MCQs:
Notify
Wait
InputStream access
Sleep
10-What state does Thread enter in when it has been created and started?
a) New
b) Runnable
c) Sleep
d) Terminated
11- What are valid point about processes?
a) Processes have their own copy of the data segment of the parent process
b) Threads have direct access to the data segment of its process
c) Processes have their own address
d) All of these
12-How can we create Thread?
a) By Extending Thread class
b) Implementing Runnable interface
c) By using Executor framework - which can internally form threads
d) All
13-A thread can acquire a lock by using which reserved keyword?
a) volatile
b) Synchronized
c) Locked
d) None
c) If the thread that would resume the target thread attempts to lock this monitor
prior to calling resume, it results in deadlock formation.
d) All
19-What is difference between starting thread with run () and start () method?
a) There is no difference
b) When you call start () method, main thread internally calls run () method to
start newly created Thread
c) Run () calls start() method internally
d) None
20-What state does Thread enter in when it has been created and started?
a) New
b) Runnable
c) Running
d) Waiting