What are the two ways you can synchronize a block of code?

Answer Posted / popol83

I think using mutex is the second way.
Because synchronizing an object is useless

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by constant time complexity?

594


explain copyonwritearraylist and when do we use copyonwritearraylist?

534


What is token in java?

533


How do you bind variables?

516


Can we write method inside a method in java?

519






What is the difference between instanceof and isinstance?

559


What is locale in java?

571


Why Java is not pure Object Oriented language?

637


What is the difference between keyword and identifier?

525


What is hash in java?

509


What is lambda in java?

515


Explain method local inner classes ?

587


Is set thread safe java?

499


What is the use of pattern in java?

504


Explain differences between collection api and stream api?

608