• Post Reply Bookmark Topic Watch Topic
  • New Topic

what are the Threads runs when a java program running?

 
jacob deiter
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are the Threads runs when a java program running?
 
Ankit Garg
Sheriff
Posts: 9597
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!