ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (146)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
what is the use of reference variable
 Question Submitted By :: Core-Java
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
A reference variable is used to refer a particular object
location which resides on a garbage collectable heap
 
Is This Answer Correct ?    15 Yes 6 No
Ravikiran(aptech Mumbai)
 
Answer
# 2
reference will act as variable to point an object. Instead
of giving direct memory location(using pointers)to the
programmer java internally converted them into references,
so that java can avoid memory leaks and increase performance
in accessing object.
 
Is This Answer Correct ?    4 Yes 0 No
Venkatesh
 
 
 
Answer
# 3
As Pointers are not safe and secure which allows us to increament or decreament the memory locations such that we can reach the O.S related files.
So to avoid such insecurities we go with Reference Varaibles where we can't increament or decrement memory location of an object.Even if we try to print the address of the object it prints some hash code
 
Is This Answer Correct ?    2 Yes 0 No
Siri
 
Answer
# 4
c++ supports one more type of variable called reference
variable.In addition to pointer variable and value variable
of creference variable behaves similar to both vaule
variable and pointer variable.reference variable has all
acces that variable has.
 
Is This Answer Correct ?    3 Yes 2 No
Aatish Maskariya
 
Answer
# 5
The reference variable is useful in OOP because it permits the manipulation of objects by reference, and eliminates the copying of object parameters back and forth. It is also important to note that reference can be created not only for built_in data types but also for user defined data types such as structures and classes 
Is This Answer Correct ?    0 Yes 0 No
Seema Yadav
 
Answer
# 6
A refference variable is a variable which will act as a
adress to a object.... in stack area and the object which
is created will get allocated memory in heap area.
 
Is This Answer Correct ?    1 Yes 3 No
Venkatachalapathy
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is the relationship between a method?s throws clause and the exceptions that can be thrown during the method?s execution?   2
difference throws and throw in java   3
String is an immutable object. Then how can the following code be justified. String s1 = ?ABC?; String s1 = s1+?XYZ?; s.o.p(s1); The output is ABCXYZ, which is the value of s1 ? Flextronics 6
What is interface and its use? HCL 7
Accenture NJ mostly ask question on Collection like 1)How to sort Objcts and how treeset sort them 2)Explain mechanism of Hashcode finding in Java 3)Name some of the Sorted collection. Accenture 2
interface X{ void m1(); void m2(); } class Child2 extends Object implements X { public void m1(){ System.out.println("Child2 M1"); } public void m2(){ System.out.println("Child2 M2"); } } public class ParentChildInfterfaceDemo { public static void main(String[] args){ X x = new Child2(); X x1 = new Child2(); x.m1(); x.m2(); x.equals(x1); } } Will the above code work? If yes? Can you please explain why the code x.equals(x1) will work as the equals method is called on interface reference vaiable?   2
Hi Friends, Can u give few interview questions which relates ArrayList and Hashmap. I mean how to link ArrayList and HashMap.I know this is not good way of asking questions like this , but i need Microsoft 1
transaction attributes ?   2
Is it possible to write static method in abstract class? justyfy your answer? Hexaware 5
What is Transient and volatile iFlex 10
in a constructor what happen if u call super and this in the same class? i know that it is not possible to call both in the same one? if we call what will happen? ITC-Infotech 10
how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access? Verizon 1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com