Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q2: Address with two private variables: area (String) and houseNum (int). Write a constructor with two parameters. The first parameter should initialize the area variable

Q2:

Address with two private variables: area (String) and houseNum (int). Write a constructor with two parameters. The first parameter should initialize the area variable and the second parameter should initialize the houseNum variable. Assume setters and getters methods are implemented (Don't write them) 2. [1 mark] Write the method toString() , which return the area and the houseNum.

3. [3 marks] Define a class for:

"Customer" with two private variables: houseAdd (Address) and id (int). Write a constructor with two parameters. The first parameter should initialize the houseAdd variable and the second parameter should initialize the id variable. Write setter and getter for the variable houseAdd. (Don't write setter and getter for id) 4. [1 marks] In a test class with main method, write a code to create a Customer object with house address: Falaj Haza, 134 and id : 10

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

Step: 3

blur-text-image

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions