Hi Jon,
A way the Person object could be connected to the getAddress method
could be if the Person object "HAS-A" reference to an Address object
and delegates the functionality of its address retrieval method to
Address.getAddress():
public class Person {
private AddressInterface address = new Address(); // polymorphism
public AddressInterface getAddress() {
return address.getAddress(); // delegation
}
}
... and the Address object "IS-A" AddressInterface:
public class Address implements AddressInterface {
private String street;
// other Address variables
public AddressInterface getAddress() {}
// other Address methods
}
For further reading I'd suggest googling for "polymorphism" and
"delegation" in regards to their implementations in Java.
Hope this helped.
Have a good day,
Geoff.
On Mar 7, 2:20 am, "Jon Carlson" <[email protected]> wrote:
> I seem to still be having trouble connecting the person object to the
> getAddress() method. I realize that they are related by interfaces, but I
> can't seem to picture how to put them together.
>
> Jon Carlson P.E.
>
> Engineering Director
>
> CC Technics, Inc.
>
> 253-250-1600 cell
>
> 253-473-9295 office
>
> 253-476-2712 fax
>
> <mailto:[email protected]> [email protected]
>
> <http://www.cctechnics.com>www.cctechnics.com
>
> DISCLAIMER:
>
> This message is confidential, intended only for the named recipient(s) and
> may contain information that is privileged or exempt from disclosure under
> applicable law. If you are not the intended recipient(s), you are notified
> that the dissemination, distribution or copying of this information is
> strictly prohibited. If you received this message in error, please notify
> the sender then delete this message.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---