devxlogo

March 20, 1997

What is the Thread.interrupt()method’s purpose?

Question: What is the purpose of the Thread.interrupt()method? I expect that if I call the interrupt()method of a sleeping thread, anInterruptedException will be thrown. Here is aquick code sample showing

Passing Data Between Two Threads

Question: I am new to Java and am currently trying toassociate idioms and techniques from otherlanguages/environments with like capabilities inJava. Specifically, I am trying to determine howto perform inter-thread and

How to calculate sqrt()

Question: How do you calculate sqrt()? Answer: Of course the best way to compute square roots is to useMath.sqrt(),but I assume your question is academic. I’m not sure of the

Appending to a File

Question: How can I append to a file in Java?The file is ASCII. It exists. The program hasrights to the file. I just need to add to the endof the

Launching Another Application from Java

Question: Is it possible to launch another application from aJava application (not an applet)? Answer: Yes. There are two classes of interest for performingsystem level functions such as this: java.lang.Runtime