answersLogoWhite

0


Best Answer

Synchronized Methods are methods that have the keyword synchronized in the method signature.

Synchronized statements are pieces of java code that are surrounded by brackets which have the keyword synchronized qualifying them.

Both cases mean that - only one thread will be able to access the method or the statement that is synchronized

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Synchronized Methods are methods that have the keyword synchronized in the method signature.

It means that - only one thread will be able to access the method that is synchronized

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the synchronized methods and synchronized statements in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can a method be static and synchronized?

Yes. In Java methods can be static and synchronized. Static methods access other static members in the class. Static in case of inheritance are treated as non - static. Synchronized methods are those which have dedicated thread attached to it and no other can access until currrent thread leaves the control from it.


Why do you use synchronized block in java?

A Synchronized block is a block of code enclosed by the {} braces that has a synchronized keyword before it. This block of code is similar to a synchronized method and only one thread can access it at a time.


How you make shared and synchronized variable in java thread?

A Variable that is shared as well as synchronized cannot be created in Java. These two terms are mutually exclusive and a variable that is synchronized in java cannot be shared and vice versa


How does one get java synchronized?

The Java program needs to be synchronized. Doing so can be complicated, but can be done. The best way to synchronize would be using the website and walk through the steps.


Is it possible to override overloaded methods why?

Yes. Overloaded methods are also Java methods and all Java methods can be overridden.


Explain three different methods in java?

There are three different methods /functions in java are there : 1)computational methods.2)manipulative methods.3)procedural methods.


What is the pane in which the Java programming statements are located called?

The pane in which the Java programming statements are located is called


What are the three looping statements in java PL?

There are 4 different looping statements in Java. They are:While loopDo-While loopFor loopFor Each loop


What is synchronize in java?

Synchronization is a feature by which only one thread can access a resource in a particular time of instance. No other thread can interrupt for that resource. In java to make our method synchronize we use synchronized keyword with that method. So Synchronization is just managing the resources among Threads. Vijai Shanker Just to add with the invent of Java 5 we have more option to write synchronized code in Java instead of using synchronized keyword we can use Lock Classes available in concurrency package.


What are the statements in java?

There are many kinds of statements that are used in Java and they are predominantly used for database connectivity using JDBCEx:PreparedStatement - for normal SQL QueriesCallableStatement - for stored procedures


What is a java object?

A java object is a collection of methods and properties defined in the Java programming language.


What is synchronized object in java?

synchronisation means one resource should use one system at a time