Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is a thread?

Answer Posted / venod.r.g

Thread is a class which extends Thread class or Implements
Runnable Interface.
Thread can run as an Independant process than current
Excecution steps. The Main thread that runs always is known
as CurrentThread accessed by Thread.currentThread();
Only one thread can access CPU time ( JVM then CPU). Multi
thread mechanisum is possible by making several threads in
waiting state and running only one at a time.

JVM assign priorities for every threads and accesses in a
Time Slicing / scheduled way considering the OS.

Defauls is normal.

Every object is like a Football to threads. hence Every
object must have methods to handle a thread. All the
players may be running in the field but only one player can
handle the Ball at a time. Object have methods like wait(),
notify() notifyAll() etc to catch and release the working
thread.

If you do not want a ball to change shape once it is
accessed by a thread then you need to synchronise the
statements or methods. Once synchronized the thread which
is the owner of the Object can only change the state of the
object.
//Method
public void synchronized x(){
}

//statement
synchronized (x);

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between comparison done by equals method and == operator?

1023


What is a text string?

1084


How to use Media tracker Class.

1128


List any five features of java?

1030


What is the association?

986


What is difference between java and java ee?

1026


Does java allow overriding static methods ?

1112


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

1129


What is the use of pattern in java?

1057


How big is a boolean?

1033


What is backdrop?

1068


What are access specifiers in java ?

1138


Difference between Preemptive scheduling vs. Time slicing?

1021


What methods are used to get and set the text label displayed by a button object?

1016


What is private static in java?

1041