Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

please reply rahul......  RSS feed

 
asheet anand
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me is there any difference between
main method & main thread?
 
Mohan Guru
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every running process in a program is called a Thread.
JVM calls the main()method(main thread).So both are same.
main() is always running as main thread.
 
mohit joshi
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean main thread and other threads, try this out
if you create a child thread in main thread and then set the main thread to null, the program exits, i.e., the child thread also dies
if you create a child thread within another thread and then equate the parent thread to null, the child thread still keeps running.

Now that i read your question again, I realize that you are asking something else.
sorry for the diversion.

[This message has been edited by mohit joshi (edited November 19, 2000).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!