Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: When the default daemon thread starts?

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default When the default daemon thread starts?

    When a Java Virtual Machine starts up, there is usually a single non-daemon thread. So when the default daemon thread is created?


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: When the default daemon thread starts?

    Quote Originally Posted by tcstcs View Post
    When a Java Virtual Machine starts up, there is usually a single non-daemon thread. So when the default daemon thread is created?
    As soon as compiler invokes main().

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: When the default daemon thread starts?

    As soon as compiler invokes
    The compiler doesn't call any methods in the code it is compiling. The JVM created by the java command calls the main() method to start a class's execution.

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: When the default daemon thread starts?

    Quote Originally Posted by Norm View Post
    The compiler doesn't call any methods in the code it is compiling. The JVM created by the java command calls the main() method to start a class's execution.
    Yep. Sorry. My bad.

  5. #5
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: When the default daemon thread starts?

    thanks for the info

  6. #6
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: When the default daemon thread starts?

    Suppose i have a program
    Public class Test{
    public static void main(String[] args)
    {
    }
    }

    When program starts execution,will there be 3 threads
    1. Non-Daemon thread which is there before Daemon has started
    2. Daemon thread
    3. Thread which is executing this program.

Similar Threads

  1. Default Dialog box changes size
    By anu21g in forum AWT / Java Swing
    Replies: 3
    Last Post: January 2nd, 2012, 05:46 AM
  2. default Value of char
    By chronoz13 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 12th, 2011, 09:25 AM
  3. [SOLVED] How to choose a different toString() Besides the default one?
    By Hallowed in forum Java Theory & Questions
    Replies: 12
    Last Post: April 8th, 2011, 03:05 PM
  4. question about default of outFile()
    By odine in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: August 18th, 2010, 12:11 PM
  5. Replies: 5
    Last Post: August 5th, 2010, 09:16 PM