Question
Beginning with Java 7. What method do you override to provide the code thats executed by a thread? a. exec c. run b. start d.
Beginning with Java
7. What method do you override to provide the code thats executed by a thread?
a. | exec | c. | run |
b. | start | d. | task |
8. Consider the following program:
public class CountDownApp { public static void main(String[] args) { Thread t1 = new CountDown(); Thread t2 = new CountDown(); t1.start(); t2.start(); } }
Assuming that the CountDown class extends the Thread class, how many threads are used to run this program?
a. | 1 | c. | 3 |
b. | 2 | d. | 4 |
9. How long will a thread that executes the following statement sleep?
Thread.sleep(50);
a. | exactly 50 milliseconds | c. | at least 50 milliseconds |
b. | at most 50 milliseconds | d. | none of the above |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started