| Author |
pass by reference problem?
|
harsh garg
Ranch Hand
Joined: Jul 13, 2008
Posts: 33
|
|
|
in pass by reference we generally pass class name and it's object,like this way can we pass interface and it's object?
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
harsh garg wrote:in pass by reference we generally pass class name and it's object,like this way can we pass interface and it's object?
you can declare interface reference as a parameter . and you can pass a object which implements the interface . and also you cant instantiate an interface
|
 |
rakesh kumar nampally
Ranch Hand
Joined: Feb 03, 2007
Posts: 44
|
|
Hi,
You can declare Interface and its reference in parameter list as , to this method you can send the object references which implement this Interface.
Thanks,
Rakesh.
|
thanks & regards, Rakesh
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
|
If you pass by reference you aren't writing Java. Java works entirely on a pass-by-value basis. We have an FAQ about that. You can also do a search on this forum and you find all sorts of useful things about it, including my post in this thread, which has some useful links to other threads or resoures.
|
 |
 |
|
|
subject: pass by reference problem?
|
|
|