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 ..
An object can assume the type of its parent. One way is to implement
an interface:
interface AddressInterface {}
class Address implements AddressInterface{}

Given above hierarchy, this method returns an interface:
AdressInterface getAddress(){
 return new Address();
}
>
> 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