- Select all correct statements:
- JVM process can have main threads
- Main thread is the main process
- A process can launch another process
- A thread may launch another thread
- Select all correct statements:
- A daemon is a user thread
- A daemon thread exits after the first user thread completes
- A daemon thread exits after the last user thread completes
- Main thread is a user thread
- Select all correct statements:
- All threads have java.lang.Thread as a base class
- All threads extend java.lang.Thread
- All threads implement java.lang.Thread
- Daemon thread does not extend java.lang.Thread
- Select all correct statements:
- Any class can implement the Runnable interface
- The Runnable interface implementation is a thread
- The Runnable interface implementation is used by a thread
- The Runnable interface has only one method
- Select all correct statements:
- Thread name has to be unique
- Thread ID is generated automatically
- Thread name can be set
- Thread priority can be set
- Select all correct statements:
- Thread pool executes threads
- Thread pool reuses threads
- Some thread pools can have a fixed count of threads
- Some thread pools can have an unlimited count of threads
- Select all correct statements:
- Future object is the only way to get the result from a thread
- Callable object is the only way to get the result from a thread
- Callable object allows getting the result from a thread
- Future object represents a thread
- Select all correct statements:
- Concurrent processing can be done in parallel
- Parallel processing is possible only with several CPUs or cores available on the computer
- Parallel processing is concurrent processing
- Without multiple CPU, concurrent processing is impossible
- Select all correct statements:
- Concurrent modification always leads to incorrect results
- Atomic variable protects the property from concurrent modification
- Atomic variable protects the property from the thread interference
- Atomic variable is the only way to protect the property from concurrent modification
- Select all correct statements:
- Synchronized method is the best way to avoid thread interference
- The synchronized keyword can be applied to any method
- Synchronized method can create a processing bottleneck
- Synchronized method is easy to implement
- Select all correct statements:
- Synchronized block makes sense only when it is smaller than the method
- Synchronized block requires shared lock
- Every Java object can provide a lock
- Synchronized block is the best way to avoid thread interference
- Select all correct statements:
- Using a concurrent collection is preferred rather than using a non-concurrent one
- Using a concurrent collection incurs some overhead
- Not every concurrent collection fits every concurrent processing scenario
- One can create a concurrent collection by calling Collections.makeConcurrent() method
- Select all correct statements:
- The only way to avoid memory consistency error is to declare the volatile variable
- Using the volatile keyword guarantees visibility of the value change across all threads
- One of the ways to avoid concurrency is to avoid any state management
- Stateless utility methods cannot have concurrency issues