Answer: System.gc() and garbage collection : Questions « Thread « SCJP
Java Source And Data Type
The notify() method is defined in class java.lang.Thread(True/False)
When a thread is waiting as a result of wait(), it releases its lock(True/False)
Answer: wait() and lock
The notify() method causes a thread to immediately release its lock(True/False)
Answer: notify and lock(2)
notifyAll() notifies all waiting threads, regardless of the object they're waiting on(True/False)
Answer: notifyAll and waiting threads
What is the result of this code(wait and time)?
Answer: wait and time
What is the result(extends Thread)?
Answer: extends Thread
What is the output(two threads)?
Answer: two threads
What is the output(joining thread)?
Answer: joining thread
What is the output(synchronized block and thread)?
Answer: synchronized block and thread
The following code will start the garbage collection mechanism(True/False)?
Answer: System.gc() and garbage collection
Calling Runtime.getRuntime().gc() will probably start the garbage collection mechanism, but there is no guarantee(True/False)?
Answer: Runtime.getRuntime().gc() and garbage collection
The garbage collection Thread has a low priority(True/False)?
Answer: garbage collection and thread
Which method must appear in the class to satisfy the Runnable interface requirements.
Answer: Runnable interface
Which statements are correct after executing the following line:
Answer: thread state
What could be put to XXX to prevent Thread collisions?
Answers: synchronized and synchronizable
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.