Java Reference
In-Depth Information
able to print names and addresses of both people and companies then you will have to cre-
ate 2 classes. Now if you want to create a program which will be used to print all the ad-
dresses then you will have to call both methods in that program. This could be a problem
as the user may need to select each class for printing.
Using a common interface can solve this problem. If a common interface is built then it is
possible for the user to call just the interface and it will print all the addresses.
Search WWH ::

Custom Search