Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java Interface as method parameter and return type

807589Sep 1 2008 — edited Sep 1 2008
Hi,

I am new to java programming and have a question. Is it possible to pass java interface as a method parameter?

In the example below the IHOConnection interface has 2 methods defined and no constants defined in it, but there is no implemented class available. How the values are being passed/ retrieved from this method?

public HOContent makeEntry(HO aRequest, IHOConnection aConnection) throws HOPopulateException

2. public IMessage receiveResponse(long aTimeout)
throws BOException

The above method returns a value of type IMessage interface. This interface has an implemented class. How to receive the return value of this method? Need to create an instance of class that implements IMessage?

thanks,
Satheesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2008
Added on Sep 1 2008
6 comments
2,453 views