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 / vikki

There are two ways to syanchronize access to an object

1st one is using synchronized keyword for example

Synchronized type methodname(arg-list)
{
//synchrinized method body
}

2nd way s using synchronized block

synchronized(object)
{
//synchronized statement

}

Is This Answer Correct ?    30 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between class and structure.

1132


What is string syntax?

1052


What is a treeset class?

1006


When throws keyword is used?

1000


Explain about OOPS concepts and fundamentals.

1044


What are dot operator queries?

1103


Are arrays static in java?

1053


What advantage do java's layout managers provide over traditional windowing systems?

956


What is better- service oriented or batch oriented solutions?

2218


What is return null in java?

962


Is null a string in java?

1071


What is oop in java?

1055


What are different types of multitasking?

956


os is developed in c no java is more secured then c na why dont the os developed is developed using java

4227


What is thread safe java?

917