Firstly,the first line of an output of the program below is The main thread dies here. Why it starting from there
Newly created threads #1 and #2 both sleep at the beginning, so it's natural to run the non-sleeping main thread. But even without that it's up to the JVM to schedule threads. You shouldn't expect thread X to start being executed before thread Y just because it was created earlier; it may work out that way (and probably will), but not necessarily so. You could insert print statements at the beginning of the run method to see when each thread starts to execute.
Second question, there are while(true) loop so, it should never end unless the exception is thrown but the program does not throws an exception. So, why it starts then executing this:new Thread (new SleepyThread(5, "1 ")).start();
I don't understand this question; can you rephrase it? What did you observe happening, and what were you expecting instead?
and the last question why it is doing more 2 thread than first is it because of the program says to or ... smth else?
Is it? It's pretty evenly distributed on my machine. Of course, thread #2 waits for a shorter time than thread #1 at startup, which explains the consecutive 2s at the beginning.