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
Differentiate between class and structure.
What is string syntax?
What is a treeset class?
When throws keyword is used?
Explain about OOPS concepts and fundamentals.
What are dot operator queries?
Are arrays static in java?
What advantage do java's layout managers provide over traditional windowing systems?
What is better- service oriented or batch oriented solutions?
What is return null in java?
Is null a string in java?
What is oop in java?
What are different types of multitasking?
os is developed in c no java is more secured then c na why dont the os developed is developed using java
What is thread safe java?