Given the following code, the correct code to replace the \"missing code\" comme
ID: 3859790 • Letter: G
Question
Given the following code, the correct code to replace the "missing code" comment is: public class Address{ private String street: private String city: private String state: private String zip: public Address(String road, String town, String st, String zipCode) { street - road: city = town: state = st: zip = zipCode: } public String tostring() { return (street + ", " + city + ", " + state + " " +zip): } public class Person { private String lastName: private String firstName: private Address home: public Person(String last, String first, Address residence) { lastName = last: firstName = first: home = residence: } public String toString() { //Chose the missing code } } return(firstName + "" + lastName + ", " +home) retum(firstName + + lastName + ", " +home.toString()): firstName + " " + lastName + ", " +home.toString(): return firstName.printString() + lastName.printString() + home.printString();Explanation / Answer
Missing Code:return(firstName+" "+lastName+","+home.toString());
Explanation: The method should return the string represention of the person. So we call toString method on the Address object to concatenate with the firstName and lastName of person