Tim Davis wrote:... it just returns me [contactlist.PersonalContact@55f96302].
All things are lawful, but not all things are profitable.
Tim Davis wrote:So when I add a business contact and go to view it I want to see everything from the main Contact class as well as jobTitle and organization from the business contact subclass. Then when I write my code as follows:
I can return a single value such as jobTitle and will get it to display properly but when I try return String(BusinessContact) it tells me can not find symbol.
Tim Davis wrote:That option definitely works but I was looking to have it output in a list not a line across.
Right now I am getting first name = John, last name = doe, etc....
I was looking for
first name = John
last name = Doe
etc....
That is why I was using System.out.println(this.firstName), etc... ao I could list it out.
How can I do this using return?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |