Page 992 - AP Computer Science A, 7th edition
P. 992

10. (B) Since the Address class does not have a toString method, each data field must explicitly be printed. Segment III would work if there were a toString method for the class (but there isn’t, so it doesn’t!). Segment I fails because of incorrect use of the for-each loop: The array index should not be accessed.


































































































   990   991   992   993   994