This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes what are the Threads runs when a java program running? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what are the Threads runs when a java program running?" Watch "what are the Threads runs when a java program running?" New topic
Author

what are the Threads runs when a java program running?

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
what are the Threads runs when a java program running?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

well when a program is running, there are threads that we create that are running. If your program is a simple console program, then there is a main thread which executed the main method and other threads that you create in the main thread. Also there are a few daemon threads run by the JVM. I know of one such thread i.e. the garbage collector but I'm sure there would many more like that...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41598
    
  55
I've put a code example called ThreadLister in the Code Barn. It enumerates all active threads. If you run that in a GUI app, or a web app, there will be quite a few more threads than if you run it from the command line.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what are the Threads runs when a java program running?