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...


How the threads are synchronized?

Answers were Sorted based on User's Feedback



How the threads are synchronized?..

Answer / seshadri pera

Threads are synchronized in two ways.

1) block level
2) Method level

Block level synhronization is the better performance
compare to method level.

Block Level:
see the code syntax for block level
synchronized {..
....//code to lock the specific object here..
...}

Method Level:
See the syntax
public void synchronized XXXMethodName(Parameters or
object to acquire locking){.....
...}

Is This Answer Correct ?    7 Yes 1 No

How the threads are synchronized?..

Answer / dsr

By using wait(),notify and notifyall() methods in the code.

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Core Java Interview Questions

What are advantages of using Java?s layout managers than windowing systems?

0 Answers  


What is a void return type?

6 Answers  


Can we force the garbage collection to run?

0 Answers  


What are loops in java?

2 Answers  


Is null a keyword in java?

0 Answers  


how many ways we can serialize the java object?

2 Answers   Satyam,


What is the base class of all exception classes?

0 Answers  


What is variable and constant explain with example?

0 Answers  


Is it possible to compare various strings with the help of == operator? What are the risks involved?

0 Answers  


Explain the difference between an object-oriented programming language and object-based programming language?

0 Answers  


What are the types of loops in Java, and how are they used?

2 Answers  


relation between list and linked list

1 Answers   Infosys,


Categories