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...

why the sleep method does not leave the lock and wait method
leave the lock

Answer Posted / amit singh

every class has an object lock but when you used
synchronized block or synchronized method
means to say the when you use synchronized keyword then the
object lock come in an existence without you don't get the
lock on particular object you
must know that wait()
1) what is the purpose of when you call wait on the object
which lock you get when you use synchronized block or method
then particular thread immediate leave the
lock so means to say that wait must to use when you get the
lock on the particular object without

2)its your turns to think that there is any mendotary
to call Thread.sleep() method in synchronized block
so whe there is no relation b/t sleep and Monitor(i'm saying
lock on the object)
why youthink it like that why the sleep() doesn't leave the
lock and wait() leave the lock

3) ther is no realtion between object lock and sleep
amit singh
amitsing2008@gmail.com

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is custom tag in java?

889


Can we use lambda without functional interface?

929


What is reflection in java?

932


What is optional in java 8? What is the use of optional?advantages of java 8 optional?

903


How do you run an executable jar file?

933


What is hql in java?

860


What is the difference between Logical Parallelism and Physical Parallelism?

3380


What is the difference between jar and executable jar?

976


Why serialization is used in java?

1040


If you’re overriding the method equals() of an object, which other method you might also consider?

921


What is savepoint in java?

837


Is it correct to say that using parentheses can only change?

886


What is ioexception in java?

934


explain how java se 8 data and time api solves issues of old java date api?

927


What are the advantages of lambda functions?

940