This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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: 41132
    
  45
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
 
jQuery in Action, 2nd edition
 
subject: what are the Threads runs when a java program running?
 
Similar Threads
daemon Vs User Thread
daemon threads
IBM mock: Daemon and user thread?
what are daemon threads?
no of threads that runs when u run a java program