Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3 : Address Implement a class Address. An address has a house number, a street, an optional apartment number, a city and a postal

Exercise 3: Address
Implement a class Address. An address has a house number, a street, an optional apartment number, a city and a postal code. Supply two constructors: one with an apartment number and one without. Supply a print (not a get) method that prints the address with the street on one line and the city, state, and zip code on the next line.
Use the following tester class:
public class AddressTester
1
public static void main(String[l args)
(
Address al = new Address ("1b","Bk_m Sokak", "Ankara", "06680");
Address a2- new Address("10","2","ilek Sokak", "Istanbul", "34714");
al.print ();
a2.print ();
}
}
image text in transcribed

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago