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 are the two ways you can synchronize a block of code?

Answer Posted / ajay tiwary

The way you can synchronize the block is:-

synchronized(dummy object)
{
//synchronized statement

}
In dummy object you can use this or u can create a dummy
object by using new Keyword.

What answer Vikki is posted as the first one is not the way
of synchronizing the block but it's a way to synchronizing
a method.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When the constructor of a class is invoked?

1028


What does pointer mean?

1051


What is the use of singleton class?

968


Can we change the value of static variable?

958


if u open login & logout ,how can udisplay the timelogin & logout members ?

2283


What is difference between == and === in js?

1008


String class is defined under which package in java?

1076


Define an enumeration?

1039


Explain the difference between comparator and comparable in java?

943


Do I need to import java.lang package any time? Why?

1383


What is pojo class in java?

1097


Where pragma is used?

1042


What is == mean?

996


what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

2172


Can we define constructor in inner class?

1000