aspose file tools*
The moose likes Beginning Java and the fly likes pass by reference problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "pass by reference problem?" Watch "pass by reference problem?" New topic
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: 46
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: 39408
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pass by reference problem?