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 (1722)
 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 (147)
 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 7 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
 
Can we inherit the constructor in a Class?please give one example. iGate 9
why string is not taking as primitive datatypes but we r taking it as a class? why explain it? HP 2
Why are inner classes required? Oracle 3
Is it possible to write JAVA program without including any of the packages,such as "import java.io.*"; bcoz I instantly wrote a code without "import..." statement and runned the program on command Line & it worked. the code is: class Person { String name; int age; Person(String s,int a) { name = s; age = a; } accept() { System.out.println(name+"Hi!!!!!"); System.out.println(age); } } class Demo { public static void main(Strings args[])throws IOException { String name = args[0]; int age = Integer.parseInt(args[1]); Person p = new Person(name,age); p.accept(); } }   3
can we override the main() method in java????   3
How a class can implement an interface? SysArc 5
1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual words of the sentence. 4) Reverse string without using temp string. HCL 2
what is Assertion? Wipro 4
How the threads are synchronized? BMC 2
what is the difference between @include page and @include file   2
Differences between jdk 1.4 and 1.5 Wipro 6
What is the range of the char type?   3
 
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