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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
Explain pass by reference and pass by value?
 Question Submitted By :: Harsha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Explain pass by reference and pass by value?
Answer
# 1
Passing the address itself rather than passing the value is 
called ?Pass By Reference? and  Passing a copy of the value 
to be passed is called as ?Pass by Value?.
 
Is This Answer Correct ?    1 Yes 1 No
Harsha
 
  Re: Explain pass by reference and pass by value?
Answer
# 2
***In Java, primitives and object references are passed by 
value.*** 
The variable represents the bit information which is copied 
to the parameter. 

eg:primitive****
Say for primitives x=2, the value of 2 is represented in 
bits and it is copied to the parameter variable.

eg:object reference*** 
Button b = new Button("hello");
Button c = b;
Similarly for object reference the bit value in the 
reference is copied to the parameter reference. Thus both 
references have the same value representing an object. The 
object reference(bit representation) represents a way to 
get to the object.
 
Is This Answer Correct ?    1 Yes 0 No
Ganesh Nagalingam
 
 
 
  Re: Explain pass by reference and pass by value?
Answer
# 3
Pass-by-value means, Passing a copy of the value.
Pass-by-reference means, instead of passing the actual
value, the address(of the value) is passed.
 
Is This Answer Correct ?    1 Yes 0 No
Vikas
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
How to send a request to garbage collector?  3
What is the argument type of main() method?  2
What is numeric promotion?  1
what is business delegate? TCS2
What are Access Specifiers and Access Modifiers. TCS3
which swing component is similar to rich text box in .net/vb  1
How can a class be accessed, If no access modifiers are declared?  2
what is jndi? TCS1
why ,we are using jsp and html.which one is better? Photon1
What is an object?s lock? Give name of object?s that have locks?  1
What Method and class used for Connection pooling ? Wipro2
Explain the difference between getAppletInfo and getParameterInfo?  1
perpare on factorypattern,linklist wothout using collection, (multitharding ie create producer/customer therad producer create Queue continuesly,consumer consume queue, consumer wait if queue is full,producer wait if queue is empty),diff betn sleep(1000)&wait(1000) these r the main Q ask in huawei(2008) Huawei1
How does serialization work Ordain-Solutions2
Difference between Array and vector?  3
What are batch updates. in jdbc Corent-Technology1
how to transactions(Bank transactions) in business process in ejb? Photon1
What is anonymous class?  2
can we create a instance for intwerface?  2
Difference String and String Buffer  3
 
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