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 yielding and sleeping? how they different?

Answers were Sorted based on User's Feedback



What is yielding and sleeping? how they different?..

Answer / ranganathkini

When a thread yields, its execution is paused and loses
ownership of the monitor lock giving other waiting threads a
chance to run.

When a thread sleeps, its execution is paused for the
specified duration during such an idle period, the thread
continues to retain the ownership of the monitor lock.

Is This Answer Correct ?    3 Yes 1 No

What is yielding and sleeping? how they different?..

Answer / ravikiran

yield() method will suspend all the same priority thread
which is running and gives chance to next thread to run
which is of the same priority
sleep() method will make the thread to sleep for a
particular period of time which is specified in the
argument list

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Core Java Interview Questions

Hi ,i convert contrller as jSp And presentation as servlet ...will it do? if so what are advantage and idsadvantages

2 Answers   IBM,


Explain public static void main(string args[]) in java.

0 Answers  


What are daemon Threads in java?

0 Answers   Impetus,


Distinguish method overloading and overriding

2 Answers   Tech Mahindra,


When will you define a method as static?

0 Answers  


What is variable and example?

0 Answers  


Where pragma is used?

0 Answers  


How many unicode characters are there?

0 Answers  


Explain some best practices you would apply while using collection in java?

0 Answers  


Can an interface extend a class?

0 Answers  


what is default constructor and parameterised constructor with example?

1 Answers   KPIT,


What is a Hash Table? What are the advantages of using a hash table?

0 Answers   Ciena,


Categories