Which of the following thread state transitions are valid? : Questions « Thread « SCJP






A. From ready to running.
B. From running to ready.
C. From running to waiting.
D. From waiting to running.
E. From waiting to ready.
F. From ready to waiting.








7.13.Questions
7.13.1.How to prevent shared data from being corrupted in a multithreaded environment?
7.13.2.Answer: multi-thread
7.13.3.How can you ensure that multithreaded code does not deadlock?
7.13.4.Answer: thread and deadlock
7.13.5.When you declare synchronized code, you can specify the object on whose lock the block should synchronize.
7.13.6.Answer: lock
7.13.7.How to create a thread?
7.13.8.Answer: thread creation
7.13.9.The Runnable interface declares which methods?
7.13.10.Answer: methods in Runnable interface
7.13.11.t implements Runnable interface, which Thread method to call to execute it as a separate thread?
7.13.12.Answer: start method
7.13.13.Which of the following are thread states?
7.13.14.Answer: thread status
7.13.15.Which of the following thread state transitions are valid?
7.13.16.Answer: thread state transitions
7.13.17.What is the result of this code?
7.13.18.Answer: Thread
7.13.19.What is the output(sleeping thread)?
7.13.20.Answer: sleeping thread
7.13.21.What is the result of trying to compile and run this program?
7.13.22.Answer: synchronized block
7.13.23.The notifyAll() method must be called from a synchronized context(True/False)
7.13.24.Answer: notifyAll
7.13.25.To call wait(), an object must own the lock on the thread(True/False)
7.13.26.Answer: wait()