which is the thread that will begin as soon as the execution of a java program begins? This was asked in an interview for me. so can anyone suggest the answer here
From Thread API document
When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls the method named main of some designated class).
And this thread will be called as main thread.
The thread which is created when you start is called the main thread. It is the one which invokes the main method.
Edit: apparently someone beat me to the answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With