Assume you have a programmer-defined class named Person. Assume this class includes a name instance variable, initialized
Question:
Assume you have a programmer-defined class named Person. Assume this class includes a name instance variable, initialized by the constructor’s name parameter. Suppose a driver fills a people array with Person objects. Then the driver goes back through the array and uses System.out.println(people[i]); to print the people’s names. Unfortunately, what the driver prints is Something like this:
Person@65ae6ba4
Person@512ddf17
Person@2c13da15
Person@77556fd
What is the problem and how can you fix it?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Question Posted: