What is thread?
Answers were Sorted based on User's Feedback
Answer / l.gururajan
Thread is a path of the execution in a program.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / naveen
A thread is a part of program that follows a separate path of execution.
A thread is also called a light weight process as they share common resources
| Is This Answer Correct ? | 4 Yes | 0 No |
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 |
How is it possible for two string objects with identical values not to be equal under the == operator?
what is deadlock? : Java thread
write a code, we have two thread, one is printing even no and other print the odd no.
Can a class be private in java?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
Can you make an instance of an abstract class?
What is the order of method invocation in an Applet?
How do you calculate roots in java?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What is the length of a string?
The following program is Overloading or Overriding? public class PolymorphismEx { public int sampleMethod(int a) { return a; } public String sampleMethod(int a) { return "Is it Overloading or Overriding???"; } }
4 Answers Ness Technologies, TCS,
What is Three tier architecture. Can anyone explain with a Ordinary web application Project? (JSP,Servlets,JAVA,DAO) ?