Top 250+ Solved Advanced JAVA MCQ Questions Answer
Q. What requires less resources?
a. thread
b. process
c. thread and process
d. neither thread nor process
Q. What does not prevent JVM from terminating?
a. process
b. daemon thread
c. user thread
d. jvm thread
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
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
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)
Q. Which of the following will ensure the thread will be in running state?
a. yield()
b. notify()
c. wait()
d. threakillthread()
Q. Which of these are types of multitasking?
a. process based
b. thread based
c. process and thread based
d. none of the mentioned
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
Q. In a RMI Client Program, what are the exceptions which might have tohandled?
a. remoteexception
b. notboundexception
c. malformedurlexception
d. all mentioned above
Q. Which is a one-way communication only between the client and the server and itis not a reliable and there is no confirmation regarding reaching the message tothe destination?
a. tcp/ip
b. udp
c. both a & b
d. none of the 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
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
Q. In RMI applications which program obtains a remote reference to one ormore remote objects on a server and then invokes methods on them?
a. server
b. client
c. both a & b
d. none of the above
Q. Which package is used for Remote Method Invocation (RMI)?
a. javlang.rmi
b. java.lang.reflect
c. java.applet
d. java.rmi