The Simple version:
An Interface is an object (everything is an object).  A method can
return an object, or void.

More helpful:
Ok, you're writing a nature based game where the players choose their
character based on characteristics they want.

When the player selects the movement type of their character for
example from Walker, Flyer or Swimmer, your method returns different
animals of each of these.

Walker, Flyer and Swimmer would all be interfaces, and so your methods
might look like:
 'public Walker getWalker()'
 'public Flyer getFlyer()'

ie, methods returning interfaces.

hth

mcalex


On Dec 14, 4:53 am, nn roh <[email protected]> wrote:
> Hi all,
>
> I am trying to do the homework , i didnt get this line :
>
> AddressInterface   getAddress();     how can a method return an interface ?
> can any one elaborate ..
>
> Thanks,
> Nada

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to