On Sep 4, 8:54 pm, abstract26 <[EMAIL PROTECTED]> wrote:
> Is it okay to assume that the Person class will contain the
> AddressImpl class instance?
I would say no, as the homework is based on the multiple interfaces
project, which has a PersonInterface, so that it would make more sense
to add to the main method. And besides, the purpose of an Interface is
precisely not to get directly at the class which implements the
interface.
>Logically it makes sense but i wanted to
> be sure that this is one way this homework can be done.
>
> Therefore can i write:
>
> class Person implemetns MyOwnInterface{
You miss the implementation of the PersonInterface here.
> String firstName;
> String secondName;
You don't need this line, otherwise you defeat the purpose of the
AddressInterface interface.
> AddressImpl address;
>
This, yes, that's the implementation of MyOwnInterface, except that it
should be public.
> // The person class contains a method
>
> AddressInterface getAddress(){
> }
>
> }
>
> The addressImpl class implements the AddressInterface
> where as the
> Person class implements MyOwnInterface.
See above.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---