Ahhh! Doing a little casting I see. I avoided that. It makes my code
easier to read and understand.

AddressInterface data1 = new AddressImpl(350, "Dreamland", "Korea");


You should be able to pass in all your data to the AddressInterface
and let it do the mutating like you did with person?

Hint: Person does not have an address, Address does.

Look back in this discussion. We had a time with this one.


MonkeyButt wrote:
> I don't want to give away too much of my work but I need someone to
> verify that my main method is correct so I know that I implemented the
> instructions correctly.
> Here it is:
>  public static void main(String[] args) {
>      AddressInterface ai = (AddressInterface)new AddressImpl();
>      ai.setCountry("USA");
>      ai.setStreetName("Washington St.");
>      ai.setStreetNumber(123);
>      Person p = new Person(ai);
>      System.out.println(p.getAddress().getStreetNumber() +  " " +
>                         p.getAddress().getStreetName() + " "
> +
>                         p.getAddress().getCountry() + "\n");
>     }
>
> It works so I assume I am correct in my understanding of this homework
> assignmnent.

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