What are synchronized methods and synchronized statements?

Answer Posted / sainaveen

Syncronized methods are executed only after a lock is
acheived on the classes or objects specified in the methids
and after that the methids are executed

Synchronized methods are executed after lock is acieved on
class or object specified in the synchronized statement

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!

1369


Write a singleton program?

573


What is the highest-level event class of the event-delegation model?

577


What modifiers may be used with an interface declaration?

561


What value does readline() return when it has reached the end of a file?

597






What is jboss?

576


Brief description about local interfaces?

630


Explain about RMI Architecture?

612


How a component can be placed on Windows?

2268


What is RMI and what are the services in RMI?

613


Explain phantom read?

1741


What must a class do to implement an interface?

586


Is the infobus client side only?

614


What is the relationship between an event-listener interface and an event-adapter class?

557


How substring() method of string class create memory leaks?

552