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 46 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
:D TYSM


sultana.d

  • Member
  • Posts: 320
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

About 80% of major fungal systemic infections are due to Candida albicans. Another form, Candida peritonitis, occurs most often in postoperative patients. A rare disease, Candida meningitis, may follow leukemia, kidney transplant, other immunosuppressed factors, or when suffering from Candida septicemia.

Did you know?

More than 2,500 barbiturates have been synthesized. At the height of their popularity, about 50 were marketed for human use.

Did you know?

There are over 65,000 known species of protozoa. About 10,000 species are parasitic.

Did you know?

The National Institutes of Health have supported research into acupuncture. This has shown that acupuncture significantly reduced pain associated with osteoarthritis of the knee, when used as a complement to conventional therapies.

Did you know?

Drug abusers experience the following scenario: The pleasure given by their drug (or drugs) of choice is so strong that it is difficult to eradicate even after years of staying away from the substances involved. Certain triggers may cause a drug abuser to relapse. Research shows that long-term drug abuse results in significant changes in brain function that persist long after an individual stops using drugs. It is most important to realize that the same is true of not just illegal substances but alcohol and tobacco as well.

For a complete list of videos, visit our video library