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 37 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
Great answer, keep it coming :)


EAN94

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

 

Did you know?

Adolescents often feel clumsy during puberty because during this time of development, their hands and feet grow faster than their arms and legs do. The body is therefore out of proportion. One out of five adolescents actually experiences growing pains during this period.

Did you know?

Drug-induced pharmacodynamic effects manifested in older adults include drug-induced renal toxicity, which can be a major factor when these adults are experiencing other kidney problems.

Did you know?

Glaucoma is a leading cause of blindness. As of yet, there is no cure. Everyone is at risk, and there may be no warning signs. It is six to eight times more common in African Americans than in whites. The best and most effective way to detect glaucoma is to receive a dilated eye examination.

Did you know?

Asthma occurs in one in 11 children and in one in 12 adults. African Americans and Latinos have a higher risk for developing asthma than other groups.

Did you know?

Green tea is able to stop the scent of garlic or onion from causing bad breath.

For a complete list of videos, visit our video library