keep in mind that you are 'adding to' not 're-writing' Person...

in Person you need a second constructor with all the parameters of the
1st one...

you must return an AddressInterface object from getAddress...

in the end, to display, you should have PersonXXX.getAddress
().getStreetNumber(), etc...

hope this helps you think in the right direction


On Feb 22, 4:36 pm, tselvi <[email protected]> wrote:
> Hello
> Can anyone please tell me how to implement the getAddress method with
> a return type of AddressInterface in the LAB 1027 homework excercise.
> All the setter methods in AddressInterface have primitive data type. I
> am not sure how to cast the primitive data type to AddressInterface
> type. Any help is appreciated. Please find my code for the person
> class copied below. I have coded the rest of the steps as mentiond in
> the homework exercise.
>
> public class Person extends AddressImpl implements MyOwnInterface {
>     public Person(int streetNumber, String streetName, String country)
> {
>         super(streetNumber,streetName,country);
>     }
>     //AddressInterface ai;
>
>    //AddressImpl address = new AddressImpl();
> public AddressInterface getAddress() {
>
>   return (super.getStreetNumber() + ", " + super.getStreetName() + ",
> " + super.getCountry());
>
>
>
> }
> }- Hide quoted text -
>
> - Show quoted text -

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