1.C and Java are both multi-threaded languages. ( )
2.If the thread dies, it cannot run. ( )
3.In Java , high-priority runnable threads will preempt low-priority threads. ( )
4.The program developer must create a thread to manage memory allocation. ( )
5. Before a thread calls its start method, the thread will always be in the birth period. ( )
6.When the stop() method of an ongoing thread is called, the thread will enter the dormant state. ( )
7.If the thread's run method ends or throws an exception that cannot be caught, the thread enters the waiting state. ( )
8.A thread can call the yield method to give other threads a chance to run. ( )
2. Multiple choice questions
1. Java language provides a Threads automatically reclaim dynamically allocated memory.
A Asynchronous
B Consumer
C Guardian
D Garbage Collection
2.When the method terminates, the thread can enter the death state.
A run
B setPrority
C yield
D sleep
3.Use the method to change the priority of the thread.
A run
B setPrority
C yield
D sleep
4. Threads can use the method to enable threads with the same priority to obtain the processor.
A run
B setPrority
C yield
D sleep
5.Threads can sleep for a period of time through the method and then resume running.
A run
B setPrority
C yield
D sleep
6. This method makes the object wait for the first thread of the queue to enter the ready state.
A run
B notify
C yield
D sleep
7.Methodresume( ) is responsible for restarting the execution of the thread .
A was stopped by the stop( ) method
B was stopped by sleep( ) method
C was stopped by wait( ) method to stop
D issuspend( ) method to stop
8. This method can be used to temporarily stop the current thread from running.
A stop( )
B sleep( )
C wait( )
D suspend()
The above is the detailed content of Some topics related to multi-threading, please share with everyone.. For more information, please follow other related articles on the PHP Chinese website!