Question: 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
Get step-by-step solutions from verified subject matter experts
