It's not a secret anymore!*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 9291
    
  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: 41034
    
  43
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?
 
Similar Threads
daemon threads
IBM mock: Daemon and user thread?
what are daemon threads?
daemon Vs User Thread
no of threads that runs when u run a java program