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   To Refer this Site to Your Friends   Click Here
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
question on Thread synchronization
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: question on Thread synchronization
Answer
# 1
With respect to multithreading, Synchronization is a 
process of controlling the access of shared resources by 
the multiple threads in such a manner that only one thread 
can access a particular resource at a time. In non 
synchronized multithreaded application, it is possible for 
one thread to modify a shared object while another thread 
is in the process of using or updating the object's value. 
Synchronization prevents such type of data corruption which 
may otherwise lead to dirty reads and significant errors. 
E.g. synchronizing a function:
public synchronized void Method1 () {
// method code. 
}
E.g. synchronizing a block of code inside a function:
public Method2 (){
synchronized (this) { 
// synchronized code here.
}
}

 
Is This Answer Correct ?    4 Yes 1 No
Rajani Nagandla
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Can we have a abstract class withought any method? What is a purspose of this?  1
Why non nested classes in java are not having marked as protected access specifier Google1
How to sort a vector elements that contains the user define class object? (Note: If Suppose consider, A Student class contain two data members. They are String studentName and int rollNo. I am creating Four objects for this class, each object contains students details like name and roll no. Now i am storing that objects in vector and if i retiving the elements from the vector means then it should be display in sorting order) ProdEx-Technologies2
What is cloneable interface?  5
what is generics in jdk1.5? Bally-Technologies1
What is serializable interface? Infosys8
What is a layout manager?  1
Hey buddy.. can you please tell me about the use of marker interface? And is there any link between marker interface and factory methods? Thanks in advance.  2
What is Vector?Can you elaborate how Vector is Thread safe?  3
what is the purpose of method overriding in java where v r completely re-defining a inherited method instead y can't v create a new method and define.If the question is very silly plz excuse me and do reply.Thank U!  5
What is hash method?  1
How to set the Heap size in Java ? HCL2
What is the Set interface?  2
long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) then?  3
What is the purpose of the finally clause?  3
What is difference between Iterator and for loop  4
what is the use of datasource in core java? Satyam2
how can we synchronize Hash map? CTS3
Can Applet have constructors?  3
Howmany number of objects we can store in an ArrayList. Is there any limit? TCS5
 
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