Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions