Hi Cecil

I think the idea is to have a property (a member) in your person class that is an address. Once you get the AddressInterface using getAddress() you can go further and get the street number, street name and so on. For e.g.: System.out.println(myPerson.getAddress().getStreetName());

Hope it helps
mihai


Cecil H a écrit :
The homework ask use to do the following.

Write an interface called MyOwnInterface, which has the following
method
AddressInterface getAddress();
The AddressInterface is a Java interface that has the following
methods.
int getStreetNumber();
void setStreetNumber(int streetNumber);
String getStreetName();
void setStreetName(String streetName);
String getCountry();
void setCountry(String country);
Write AddressImpl class that implements AddressInterface
Make the Person class to implement MyOwnInterface.
Initialize a Person object with proper data and display it.

How would returning the AddressInterface object work? Why wouldn't you
change
AddressInterface getAddress() to String getAddress()?

I can post all the classes I have but if someone has a quick
suggestion. I'd really appreciate the help.

Thanks
Trey


--
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

To unsubscribe from this group, send email to 
javaprogrammingwithpassion+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to