Instructions for this homework are as below:
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.
Is it okay to assume that the Person class will contain the
AddressImpl class instance? 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{
String firstName;
String secondName;
AddressImpl address;
// The person class contains a method
AddressInterface getAddress(){
}
}
The addressImpl class implements the AddressInterface where as the
Person class implements MyOwnInterface.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---