The interfaces presentation material on page 21 says
// Recommended practice
PersonInterface pi = new Person();
// Not recommended practice
Person pc = new Person();
I don't understand why this approach?
My thinking is that the "new Person()" is a Person object that implements
the PersonInterface interface; and as such the code should show that the
type is Person. Also, what if Person implements more than one interface? How
do you decide which interface type to use when writing the code?
--
Mike Conley
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---