|
|
|
1000 Java Tips ebook
|
|
 

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java
programming articles and tips. Please take your copy here.
Take your copy of free "Java Technology Screensaver"!. |
|
Easy Learn Java: Programming Articles, Examples and Tips - Page 122
Previous
1060 Stories (530 Pages, 2 Per Page)
Next
I am sure that in my program I create 100 new threads and when I use isAlive met
|
Question: I am sure that in my program I create 100 new threads and
when I use isAlive method it shows often less than 100 threads... I have not
killed even one of them!
Answer: Good, short and clear explanation I found in Java tutorial on
SUN's site:
"The API for the Thread class includes a method called isAlive. The isAlive
method returns true if the thread has been started and not stopped. If the
isAlive method returns false, you know that the thread either is a New Thread or
is Dead. If the isAlive method returns true, you know that the thread is either
Runnable or Not Runnable. You cannot differentiate between a New Thread or a
Dead thread. Nor can you differentiate between a Runnable thread and a Not
Runnable thread."
--
John.
*******************************************
Our older tips: March 22, 2001 - October 21, 2002
READ
HERE
All published and not published on the site tips read
HERE
33 comments | | Score: 0
|
Posted by jalex on Friday, January 02, 2004 (00:00:00) (3881 reads)
|
What is difference between Hashmap and Hashtable?
|
Question: What is difference between HashMap and Hashtable?
Answer: there is almost no difference, since "hashmap is Hash table
based implementation of the Map interface" (citation from API). The difference
is that Hashtable is synchronized.
*******************************************
Java Code examples for the
HashMap and
Hashtable
Read another our tip - the
Comprehensive Java Collections overview...
16 comments | | Score: 2.31
|
Posted by jalex on Monday, December 29, 2003 (00:00:00) (23572 reads)
|
|
|