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 38 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
Excellent


raili21

  • Member
  • Posts: 324
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

When taking monoamine oxidase inhibitors, people should avoid a variety of foods, which include alcoholic beverages, bean curd, broad (fava) bean pods, cheese, fish, ginseng, protein extracts, meat, sauerkraut, shrimp paste, soups, and yeast.

Did you know?

Acetaminophen (Tylenol) in overdose can seriously damage the liver. It should never be taken by people who use alcohol heavily; it can result in severe liver damage and even a condition requiring a liver transplant.

Did you know?

Chronic necrotizing aspergillosis has a slowly progressive process that, unlike invasive aspergillosis, does not spread to other organ systems or the blood vessels. It most often affects middle-aged and elderly individuals, spreading to surrounding tissue in the lungs. The disease often does not respond to conventionally successful treatments, and requires individualized therapies in order to keep it from becoming life-threatening.

Did you know?

A strange skin disease referred to as Morgellons has occurred in the southern United States and in California. Symptoms include slowly healing sores, joint pain, persistent fatigue, and a sensation of things crawling through the skin. Another symptom is strange-looking, threadlike extrusions coming out of the skin.

Did you know?

Patients who have been on total parenteral nutrition for more than a few days may need to have foods gradually reintroduced to give the digestive tract time to start working again.

For a complete list of videos, visit our video library