Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java public class Address private String streetAddress, city, state; private long zipCode; public Address (String street, String town, String st, long zip) streetAddressstreet; city-town; state
java
public class Address private String streetAddress, city, state; private long zipCode; public Address (String street, String town, String st, long zip) streetAddressstreet; city-town; state st; zipCode - zip; public String toString() String result; result-streetAddress+ " "; result +city + ", " +state + " " + zipCode; return result; public class Student private String firstName, lastName; private Address homeAddress, schoolAddress; public Student (String first, String last, Address home, Address school) firstName- first; lastName = last homeAddress-home; school Address - school; public String toString() String result; result-firstName"" + lastName " "; result +"Home Address: " + homeAddress + " "; result +School Address: " schoolAddress; return result; public class StudentBody public static void main(Stringl] args) // Creates some Address and Student objects and prints them using classes given in the previous question. Address school- Address jHome- Student john- Address mHome- Student marshaStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started