Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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 marsha

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions