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 mean by thread lock?

Answer Posted / maninder kaur

thread locking is achieve by synchronized keyword.
for eg...
public synchronized void disp()
{
}

or

public void disp()
{
synchronized(this)
{
}
}

it makes a lock on disp method until we comes to the end of the block.
so that no other thread can modify it.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you remove all elements from an arraylist in java?

949


What is the difference between integer parseint and integer valueof?

965


How does predicate work in java?

939


What is hashmap in java?

1022


Can we define private and protected modifiers for the members in interfaces?

1046


What does file separator do in java?

969


What is the default access specifier for variables and methods of a class?

1138


How do you calculate roots in java?

1014


What is sizeof () operator?

927


What are static variables and functions?

1063


What is bytecode in java ?

1118


How arrays are stored in memory in java?

924


What are synchronized blocks in java?

1066


Can private class be extended java?

967


Which is bigger float or double java?

928