File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Thread questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Thread questions

Harvinder Singh
Ranch Hand

Joined: Feb 14, 2003
Posts: 90
q1.What r daemon threads?
q2.The class in which main method is declared nither implements Runnable
nor extends thread then how JVM treats main as a non-daemon

Hard work beats talent<br />when talent doesn't work hard.<p> - Tim Notke
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

1) A very Frequently Asked Question: See Frank Carver's answer here.
2) main() runs in a Thread, but you don't see the run() method from that thread -- it's internal to the JVM implementation. But somewhere, effectively, there's a run() method that looks like

[ October 04, 2003: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9058
This is a duplicate of this post. Please don't cross post. Thanks.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: Thread questions
It's not a secret anymore!