Multi-threaded questions. When bored

Source: Internet
Author: User

Multi-threaded questions. When bored

1. Both C and Java are multi-threaded languages. ()

2. If the thread dies, it cannot run. ()

3. in Java, high-priority runnable threads will seize low-priority threads. ()

4. The program developer must create a thread to manage the memory allocation. ()

5. When a thread calls its start method, the thread will remain in its infancy. ()

6. When you call the stop () method of an ongoing thread, the thread enters the sleep state. ()

7. If the thread's run method execution ends or throws an exception that cannot be captured, the thread enters the waiting state. ()

8. One thread can call the yield method to run other threads. ()

 

Ii. multiple choice questions

 

1. a zookeeper thread is provided in Java to automatically recycle the dynamically allocated memory.

 

A asynchronous

 

B consumer

 

C daemon

 

D. Garbage Collection

 

2. When the zookeeper method is terminated, the thread enters the dead state.

 

A run

 

B setPrority

 

C yield

 

D sleep

 

3. The priority of a thread can be changed by using the sort priority method.

 

A run

 

B setPrority

 

C yield

 

D sleep

 

4. Threads can use the parallel processing method to obtain processors for threads with the same priority.

 

A run

 

B setPrority

 

C yield

 

D sleep

 

5. The thread can sleep for a period of time through the prepare thread method and resume running.

 

A run

 

B setPrority

 

C yield

 

D sleep

 

6. The prepare queue method enables the first thread of the object waiting for the queue to enter the ready state.

 

A run

 

B notify

 

C yield

 

D sleep

 

7. Method resume () is responsible for restarting the execution of the zookeeper thread.

 

A is stopped by the stop () method.

 

B is stopped by the sleep () method

 

C is stopped by the wait () method

 

D is stopped by the suspend () method

 

8. The pause method can be used to temporarily stop the running of the current thread.

 

A stop ()

 

B sleep ()

 

C wait ()

 

D suspend ()

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.