what is the use of reference variable
Answers were Sorted based on User's Feedback
Answer / venkatesh
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 ? | 14 Yes | 2 No |
Answer / ravikiran(aptech mumbai)
A reference variable is used to refer a particular object
location which resides on a garbage collectable heap
| Is This Answer Correct ? | 22 Yes | 12 No |
Answer / siri
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 ? | 8 Yes | 0 No |
Answer / seema yadav
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 ? | 3 Yes | 0 No |
Answer / aatish maskariya
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 ? | 4 Yes | 3 No |
Answer / venkatachalapathy
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 | 6 No |
Explain thread life cycle in java?
What is the char data type?
why java does not support multiple inheritance
41 Answers Diamond, Euclid, Evergent, KLKJ, Mind Tree, NIIT, SSI Small Scale Industries, Wipro,
Difference between string, string builder, and string buffer?
how to make hashmap object as synchronized object?
What is communist flag?
What is java autoboxing?
What's the difference between an abstract class and interface in java?
what do you meant by Runtime Polymorphism?
13 Answers BVIMR, IBM, Persistent,
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
What is the scope or life time of instance variables?
What is data member in java?