This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello. I am trying to learn how to multithread. So I have taken sample code from the Java Thread Programming book and modified it so that I can run two instances. When I run the following code I get two application instances however when I close one of the windows both of them close. By exiting one of the applications the other should continue to run?
Please let me know where I have made an error.
Thank you for your help.
Joined: Jul 03, 2003
Unfortunately, I was unable to add my code due to the "international abbreviation" error message. If someone would please let me know how I can, I will post another message with the code. I tried using the "Instant UBB Code" tags.
By international abbreviation error, do you mean the recently added check to prevent instant messenger shortcuts? This was added to promote more clarity in the posts -- as non-english speakers are having a difficult time understanding some of them.
Unfortunately, there is no easy tag to fix it at the moment. However, it is easy to fix externally -- the error will inform you of the invalid word that you are using.
Basically, you'll need to change your code to not use the abbreviations for "please" (P-L-Z), "great" (G-R-8), "thanks" (T-H-X), etc. If you are using an IDE, it should be a simple refactor operation.
FYI... There is a discussion in the JavaRanch forum related to this very issue. In that case, I believe it was caused by the variable "u". Anyway, if anyone would like to voice an opinion about this, along with any constructive suggestions, you may find the thread here.