Answer Posted / javamasque
Threads are lightweight process which lives inside process. These are independently running programs which have concurrent path of execution. Each thread has its own 1. Java stack 2. Program counter and 3. Native stack but have common heap space. Multiple threads with in same process share same variables and objects. They allocates objects from same heap and even they can share same instructions (execution code) at particular time. As a result above common access they can easily share information to each other.
Every program has at least one thread i.e. main thread. JVM creates main thread which calls main method to execute whole program. The main thread is non-daemon thread. Any thread created by main method is non-daemon thread by default.
JVM has daemon threads for garbage collection, object finalization and other housekeeping jobs.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are operators and its types?
how we can create packages in java?
Explain wait(), notify() and notifyall() methods of object class ?
What is the difference between iterator and list iterator?
What do u mean by variable?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
what is anonymous class in java?
Is there a sort function in java?
Does java have a compiler?
Can we inherit a class with private constructor?
How does java enable high performance?
Can a class be final?
What is parsing a sentence?
What are the ways in which a thread can enter the waiting state?
How do you create a method in java?