Vikas Saini
Posts: 2
Nickname: bikka
Registered: May, 2007
|
|
Re: java
|
Posted: May 22, 2007 11:42 PM
|
|
Reference variable is the second name of a variable. you can use that reference var in the same way as that of simple variable. and you can even Access and Modify the Original value even if the reference is located within a different scope. now why we need reference variable... 1. Effeciency gain as we don't need to make another copy of it. 2.for safety.. no need to chk whether it is initialized to NULL.
One problem is that when you use references, it's not clear that the memory backing the reference needs to be deallocated
|
|