ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
How the threads are synchronized?
 Question Submitted By :: Varsha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How the threads are synchronized?
Answer
# 1
By using wait(),notify and notifyall() methods in the code.
 
Is This Answer Correct ?    0 Yes 0 No
Dsr
 
  Re: How the threads are synchronized?
Answer
# 2
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 ?    0 Yes 0 No
Seshadri Pera
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is the difference between throw and throws? What is the similarity between try and throw?  2
whats string ? HCL8
Difference between String & StringBuffer Wipro6
Does any tag exists in HTML to upload and download files ?  2
What is the is a and has a relation ship in oops concept in java? BearingPoint5
What is Applet Flickering ? Persistent1
What is an object?s lock? Give name of object?s that have locks?  1
what is hashmap& hashtable with example? CTS1
class A{ some variables; public void a()throws Excepion1,Exception2{....} } class B extends A{ variables... public void a()throws E2,E3{.....} } Qns: here override of methods occurs or not,ore else wil give any compilation error or run properly..plz tell me briefly whts happening with the above codes.... Quinnox3
static inner classes means..?  1
Explain Global variables in Packages?  2
Is it possible to create Userdefined Unchecked Exception also?If Yes, give an example?  2
What is Generic in java? Where can we write Generic ( class or method or objects or etc...)? with simple example? Thanks, Bose. Infosys1
what is generics in jdk1.5? Bally-Technologies1
Can an object?s finalize() method be invoked while it is reachable?  2
what is difference between global methods and local methods?  1
What is user defined exception?  4
what is main purpose of abstract class?  2
Is it compulsory to have atleast one abstract method in abstract class?  7
what is prepare statement? what is calabedtarement? Symphony1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com