Top 250+ Solved Advanced JAVA MCQ Questions Answer

From 76 to 90 of 223

Q. What requires less resources?

a. thread

b. process

c. thread and process

d. neither thread nor process

  • a. thread

Q. What does not prevent JVM from terminating?

a. process

b. daemon thread

c. user thread

d. jvm thread

  • b. daemon thread

Q. What decides thread priority?

a. process

b. process scheduler

c. thread

d. thread scheduler

  • d. thread scheduler

Q. What should not be done to avoid deadlock?

a. avoid using multiple threads

b. avoid hold several locks at once

c. execute foreign code while holding a lock

d. use interruptible locks

  • c. execute foreign code while holding a lock

Q. What is true about threading?

a. run() method calls start() method and runs the code

b. run() method creates new thread

c. run() method can be called directly without start() method being called

d. start() method creates new thread and calls code written in run() method

  • d. start() method creates new thread and calls code written in run() method

Q. Which of the following is a correct constructor for thread?

a. thread(runnable a, string str)

b. thread(int priority)

c. thread(runnable a, int priority)

d. thread(runnable a, threadgroup t)

  • a. thread(runnable a, string str)

Q. Which of the following will ensure the thread will be in running state?

a. yield()

b. notify()

c. wait()

d. threakillthread()

  • c. wait()

Q. Which of these are types of multitasking?

a. process based

b. thread based

c. process and thread based

d. none of the mentioned

  • c. process and thread based

Q. What will happen if two thread of the same priority are called to be processedsimultaneously?

a. anyone will be executed first lexographically

b. both of them will be executed simultaneously

c. none of them will be executed

d. it is dependent on the operating system

  • d. it is dependent on the operating system

Q. In a RMI Client Program, what are the exceptions which might have tohandled?

a. remoteexception

b. notboundexception

c. malformedurlexception

d. all mentioned above

  • d. all mentioned above

Q. An RMI Server is responsible for,

a. creating an instance of the remote object

b. exporting the remote object

c. binding the instance of the remote object to the rmi registry

d. all mentioned above

  • d. all mentioned above

Q. In RMI Distributed object applications need to do?

a. locate remote objects

b. communicate with remote objects

c. load class definitions for objects that are passed around

d. all mentioned above

  • d. all mentioned above

Q. Which package is used for Remote Method Invocation (RMI)?

a. javlang.rmi

b. java.lang.reflect

c. java.applet

d. java.rmi

  • d. java.rmi
Subscribe Now

Get All Updates & News