This topic contains a solution. Click here to go to the answer

Author Question: When you run the following program, what will happen?public class Test extends Thread { public ... (Read 47 times)

bio_gurl

  • Hero Member
  • *****
  • Posts: 524

Question 1

You can use the ________ method to force one thread to wait for another thread to finish.
◦ sleep(long milliseconds)
◦ join()
◦ stop()
◦ yield()
◦ suspend()

Question 2

When you run the following program, what will happen?

public class Test extends Thread {
public static void main(String[] args) {
Test t = new Test();
t.start();
t.start();
}

public void run() {
System.out.println("test");
}
}

◦ The program displays test twice.
◦ The program displays test once.
◦ Nothing is displayed.
◦ An illegal java.lang.IllegalThreadStateException may be thrown because you just started thread and thread might have not yet finished before you start it again.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by bio_gurl on May 6, 2020

Carliemb17

  • Sr. Member
  • ****
  • Posts: 325
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




bio_gurl

  • Member
  • Posts: 524
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


bulacsom

  • Member
  • Posts: 329
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

Aspirin may benefit 11 different cancers, including those of the colon, pancreas, lungs, prostate, breasts, and leukemia.

Did you know?

Side effects from substance abuse include nausea, dehydration, reduced productivitiy, and dependence. Though these effects usually worsen over time, the constant need for the substance often overcomes rational thinking.

Did you know?

Oliver Wendell Holmes is credited with introducing the words "anesthesia" and "anesthetic" into the English language in 1846.

Did you know?

Hypertension is a silent killer because it is deadly and has no significant early symptoms. The danger from hypertension is the extra load on the heart, which can lead to hypertensive heart disease and kidney damage. This occurs without any major symptoms until the high blood pressure becomes extreme. Regular blood pressure checks are an important method of catching hypertension before it can kill you.

Did you know?

Excessive alcohol use costs the country approximately $235 billion every year.

For a complete list of videos, visit our video library